Creating Macros

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
matixx732
Posts: 1
Joined: 15 Jul 2018, 23:56

Creating Macros

16 Jul 2018, 00:02

Helo I need help because my keyboard had extra buttons and I don't know how to configure them. Please Help
Rohwedder
Posts: 7644
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Creating Macros

16 Jul 2018, 10:26

Hallo,
see https://autohotkey.com/docs/KeyList.htm#SpecialKeys
or try:

Code: Select all

; Show information for the last pressed key.
#InstallKeybdHook   
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
run this script and press your special key, you should get the corresponding scancode (different from SC0).
For example, you would get SC16A, then this script should work:

Code: Select all

SC16A::
    MsgBox, %A_ThisHotKey% was pressed.
Return
Same for a virtual code other than VK0 e.g. VK53:

Code: Select all

VK53::
    MsgBox, %A_ThisHotKey% was pressed.
Return
But there are sometimes special keys, especially these that are only available on specific brands, that cannot be remapped. Probably these keys do not use the usual drivers, but work at a lower level, which may not be accessible.
User avatar
Scr1pter
Posts: 1272
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: Creating Macros

16 Jul 2018, 10:30

Hi matixx732,

Please tell us what kind of keyboard you have.
I, for example, have a Logitech G15 which has 18 G-Keys and 3 modes.
The keys themselves cannot be read by AHK (in my case).

For this reason, I simply map keys or key combinations to my G keys.
Example:
G1 = Ctrl+Shift+F1
G2 = Ctrl+Shift+F2
etc.

In AHK, I link the combinations Ctrl+Shift+F1, Ctrl+Shift+F2 etc to my scripts.
Later, instead of pressing these key combinations, I just press the G keys, which is much easier.

Regards
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: OrangeCat and 324 guests