I'm using AHK 1.1.32.00 on Win 10 and I'm trying to make the system behave as close to macOS as I can get it. I'm using it both with a physical Macally keyboard and via Chrome Remote Desktop (CRD) from a Mac (latest version of Win, macOS, Chrome). Both keyboards have the same modifier keys (Fn, Ctrl, Alt/Option, Win/Cmd). I swapped Alt and Win in the Windows registry and in the CRD connection dialog. Then I'm binding several Alt Hotkeys to their corresponding Ctrl hotkeys (e.g. !t and !w should map to ^t and ^w to open and close new browser tabs, same for x/c/v etc. There are many more but I minimized the example for my question).
Code: Select all
!t::SendInput ^t
!w::SendInput ^w
However, when adding any hotkey that installs the keyboard hook, repeatedly triggering a hotkey while holding down the modifier stops working. Instead it just starts typing the letter. Instead of two new tabs I get one tab with one letter 't' in it.
Code: Select all
#Backspace::SendInput ^{Backspace}
Without the hook installed, the traces looks like this (On the remote machine, physically holding down Alt, hitting t twice, letting go of Alt):
Code: Select all
VK SC Type Up/Dn Elapsed Key Window
-------------------------------------------------------------------------------------------------------------
A2 01D i d 8.45 LControl New Tab - Google Chrome
A4 038 i u 0.00 LAlt
54 014 i d 0.00 t
54 014 i u 0.00 t
A4 038 i d 0.00 LAlt
A2 01D i u 0.00 LControl
A2 01D i d 1.28 LControl
A4 038 i u 0.00 LAlt
54 014 i d 0.00 t
54 014 i u 0.00 t
A4 038 i d 0.00 LAlt
A2 01D i u 0.00 LControl
Code: Select all
VK SC Type Up/Dn Elapsed Key Window
-------------------------------------------------------------------------------------------------------------
A4 038 a d 6.95 LAlt New Tab - Google Chrome
54 014 a d 1.00 t <-- pressing 't' for the first time
54 014 a u 0.00 t
A2 01D i d 0.00 LControl
A4 038 i u 0.00 LAlt
54 014 i d 0.00 t
54 014 i u 0.00 t
A2 01D i u 0.00 LControl
54 014 a d 1.31 t <-- pressing 't' for the second time
54 014 a u 0.00 t
A4 038 a u 1.09 LAlt
In both cases the full hotkey map looks like this:
Code: Select all
Type Off? Level Running Name
-------------------------------------------------------------------
reg #+k
reg #+r
reg !t
reg !w
So the question here is: Is this a bug? Why does the keyboard hook merely being installed mess with any regular (non-keyboard-hook) hotkeys are handled?
I also found that rewriting the hotkeys like so makes them work repeatedly:
Code: Select all
!t::SendInput {Blind}{LAlt Up}{LCtrl Down}{t}{LCtrl Up}{LAlt Down}
Thanks for any help!