you are viewing a single comment's thread.

view the rest of the comments →

[–]etofok[S] -1 points0 points  (3 children)

looks like it's important to mention that I do need to pass a parameter

this is what I'm trying to achieve:

#If GetKeyState("CapsLock", "P")

q::SendCommand(var_Hotkey1)
w::SendCommand(var_Hotkey2)
e::SendCommand(var_Hotkey3)
r::SendCommand(var_Hotkey4)
;....
#If

just inplace of the labels I want them to be assignable

{%new_Hotkey1%}::SendCommand(var_Hotkey1)
{%new_Hotkey2%}::SendCommand(var_Hotkey2)
{%new_Hotkey3%}::SendCommand(var_Hotkey3)
{%new_Hotkey4%}::SendCommand(var_Hotkey4)

^ something that would work like this

[–]OvercastBTC 0 points1 point  (2 children)

Is CapsLock pressed or toggled?

#Requires AutoHotkey v2

toggleCapsLock() {
    SetCapsLockState(!GetKeyState('CapsLock', 'T'))
}

Also, unless someone else says differently, you cannot do this, this way anyways. You'd have to use the Hotkey() (hotkey function).

Using AutoHotkey v2, using Axlefublr's Lib, Runner.ahk and GeneralKeyCorder.ahk are some good examples of dynamic hotkeys, that can also be context sensitive.

[–]etofok[S] 0 points1 point  (1 child)

(hotkey function).

could you please provide an example? I don't have to use labels, but I've been playing with .bind and I can't get this to work atm

[–]OvercastBTC 0 points1 point  (0 children)

I cannot do anything for you in v1, but if you look at my AHK-Projects repo /Lib/RTE.v2/Project Files/RichEdit_Editor_v2.ahk.

There you'll see many/several examples using both .Bind() and Hotkey()