How do you script a key that isn't part of the autohotkey registry? So far all I know is to use the keyboard hook, but I have no idea what that means. Can anyone tell me how the whole process works?
Thanks
How to use unsupported keys
-
- Posts: 2
- Joined: 17 Jul 2018, 17:51
Re: How to use unsupported keys
You didn't give much details, but please look at the 'special keys' section here: https://autohotkey.com/docs/KeyList.htm#SpecialKeys
Some keys, like Fn keys on a laptop might or might not be accessed via AHK. It depends...
Some keys, like Fn keys on a laptop might or might not be accessed via AHK. It depends...
Re: How to use unsupported keys
Hallo,
try this script. #InstallKeybdHook and #InstallMouseHook force the use of the hooks.Run this script and press your special key, you should get the corresponding scancode and virtual code.
try this script. #InstallKeybdHook and #InstallMouseHook force the use of the hooks.
Code: Select all
; Show information for the last pressed key.
#InstallKeybdHook
#InstallMouseHook
SetTimer, Information, 300
Information:
ToolTip, % Format(
(Join
"Key Name:`t{}`nVirtual Code:`tVK{:X}`nScan Code:`tSC{:X}"
,A_PriorKey,GetKeyVK(A_PriorKey),GetKeySC(A_PriorKey))
)
Return