Custom Keyboard Hotkey

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
jc0r
Posts: 29
Joined: 27 Nov 2015, 07:09

Custom Keyboard Hotkey

Post by jc0r » 07 Oct 2022, 07:33

I have a custom keyboard that i want certain actions performed when a key is pressed.

I'm getting an error as [s01 is invalid. Does anyone know a way around this? I've tried putting & between each character to no avail.

Many thanks

Code: Select all

SetTitleMatchMode, 2
SetDefaultMouseSpeed, 0

[s01::
WinActivate, Virtual Keyboard
WinWaitActive, Virtual Keyboard
MouseClick, Left, 207, 242
return

RussF
Posts: 1242
Joined: 05 Aug 2021, 06:36

Re: Custom Keyboard Hotkey

Post by RussF » 07 Oct 2022, 07:56

From the documentation here:
Combinations of three or more keys are not supported. Combinations which your keyboard hardware supports can usually be detected by using #If and GetKeyState(), but the results may be inconsistent. For example:

; Press AppsKey and Alt in any order, then slash (/).
#if GetKeyState("AppsKey", "P")
Alt & /::MsgBox Hotkey activated.

; If the keys are swapped, Alt must be pressed first (use one at a time):
#if GetKeyState("Alt", "P")
AppsKey & /::MsgBox Hotkey activated.

; [ & ] & \::
#if GetKeyState("[") && GetKeyState("]")
\::MsgBox
Russ

jc0r
Posts: 29
Joined: 27 Nov 2015, 07:09

Re: Custom Keyboard Hotkey

Post by jc0r » 07 Oct 2022, 08:08

Ahh damn, 3 or more huh? Okay, i'll look for another solution. Thanks

Post Reply

Return to “Ask for Help (v1)”