Code: Select all
F12 & SC021::MsgBox, Hello ;This works
F11 & f::MsgBo, World! ;This does not work and outputs 'f'
Is there a solution for this to continue using key names instead of scancodes?
Code: Select all
F12 & SC021::MsgBox, Hello ;This works
F11 & f::MsgBo, World! ;This does not work and outputs 'f'
Using the keyboard with different keyboard layouts Dvorak and Qwerty. The keys get remapped.mikeyww wrote: ↑21 Nov 2021, 23:29I don't believe that is the case-- and it's easy to prove with your simple test (now disproven).
My impression is that the scan code will "take over" once it is defined-- as described in the original post. I am not aware of a way around it, but also uncertain what problem or use case is being addressed through the script that cannot be handled by using the scan code alone; I do not have an example. Others may have some better explanations & workarounds.
From what I've tried, if you use the "&" for two key combos, or the "GetKeyState" with a scancode, you'll have to continue using the scancode for that key for those two functions only. the ^!+# combos work like usual with the letters.
Code: Select all
; It is F and J on Qwerty layout
sc21::
sc24::
ToolTip, % GetKeyState("sc21", "P") "`n" GetKeyState("sc24", "P") "`n" GetKeyState(A_ThisHotkey, "P")
return