Inputhook not working on remap key

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
lirouxtm
Posts: 3
Joined: 23 Apr 2024, 22:02

Inputhook not working on remap key

23 Apr 2024, 22:11

When I press shift key, It will capital the first letter. But it's not working on remap hotkey. I have this working on v1 but I can't do in V2.

Code: Select all

LShift::capsOnDisplay()
SC024::d ;j key


capsOnDisplay() {
    ;ToolTip(GetKeyState("CapsLock", "T") ? "CapsLock: On" : "CapsLock: Off")
    SetCapsLockState 1
    ih := InputHook("L1 T2 V", "{CapsLock}{LShift}{Enter}")
    ih.Start()
    ih.Wait()
    SetCapsLockState 0
}
Rohwedder
Posts: 7704
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Inputhook not working on remap key

24 Apr 2024, 00:19

Hallo,
here it works with v2.0.13
lirouxtm
Posts: 3
Joined: 23 Apr 2024, 22:02

Re: Inputhook not working on remap key

24 Apr 2024, 09:23

Rohwedder wrote:
24 Apr 2024, 00:19
Hallo,
here it works with v2.0.13
I have v2.0.13.

Further testing.
Only v2.0.13 installed = Not working. It will capital more than 1 letter.
Only v2.0.13 installed + v1 script on the tray icon on suspend = It work's perfectly.
Installed V1 and v2.0.13 and run in V1 = It work's perfectly.
Installed V1 and v2.0.13 and run in V2 = Not working. It will capital more than 1 letter.

i added some remap key because some keys work fine while others are not

Code: Select all

LShift::capsOnDisplay()
SC023::p ;j key
SC024::d ;j key
SC025::a ;j key
SC026::e ;j key


capsOnDisplay() {
    ;ToolTip(GetKeyState("CapsLock", "T") ? "CapsLock: On" : "CapsLock: Off")
    SetCapsLockState 1
    ih := InputHook("L1 T2 V", "{CapsLock}{LShift}{Enter}")
    ih.Start()
    ih.Wait()
    SetCapsLockState 0
}

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: Dazzer123, Jinjiro, kunkel321, pliev, trevzilla and 30 guests