cajhin / capsicain

Powerful low-level keyboard remapping tool for Windows
362 stars 18 forks source link

combo with ALT gets blocked #107

Closed kbilsted closed 8 months ago

kbilsted commented 8 months ago

The documentation states you can make a combo with ALT like [&...]

[CONFIG_1]
OPTION debug
OPTION configName smartnavi

COMBO  J   [&...] > key(LEFT)  
COMBO  I   [&...] > key(UP)  
COMBO  K   [&...] > key(DOWN)  
COMBO  L   [&...] > key(RIGHT)  

does not work it is getting blocked somehow

 [25 0=                Kv ] [M:   8 T:     D:      ]   --> SEQUENCE (2)   {RIGHTv #2} {RIGHT^ #1}
 [25 1=                K^ ] [M:   8 T:     D:      ]   --> {blocked K UP: was not down.} (tap)
 [25 0=                Kv ] [M:   8 T:     D:      ]   --> SEQUENCE (2)   {RIGHTv #2} {RIGHT^ #1}
 [25 1=                K^ ] [M:   8 T:     D:      ]   --> {blocked K UP: was not down.} (tap)
 [17 0=                Iv ] [M:   8 T:     D:      ]   --> SEQUENCE (2)   {UPv #2} {UP^ #1}
 [17 1=                I^ ] [M:   8 T:     D:      ]   --> {blocked I UP: was not down.} (tap)
 [17 0=                Iv ] [M:   8 T:     D:      ]   --> SEQUENCE (2)   {UPv #2} {UP^ #1}
 [17 1=                I^ ] [M:   8 T:     D:      ]   --> {blocked I UP: was not down.} (tap)
 [25 0=                Kv ] [M:   8 T:     D:      ]   --> SEQUENCE (2)   {RIGHTv #2} {RIGHT^ #1}
 [25 1=                K^ ] [M:   8 T:     D:      ]   --> {blocked K UP: was not down.} (tap)
 [24 0=                Jv ] [M:   8 T:     D:      ]   --> SEQUENCE (2)   {LEFTv #2} {LEFT^ #1}
 [26 0=                Lv ] [M:   8 T:     D:      ]   --> {Lv #2}
 [24 1=                J^ ] [M:   8 T:     D:      ]   --> {blocked J UP: was not down.}
 [26 1=                L^ ] [M:   8 T:     D:      ]   --> {L^ #1}
 [38 1=             LALT^ ] [M:     T:     D:      ]   --> {LALT^ #0}                                        

If I instead rewire to a modifier it works

REWIRE LALT    MOD15

COMBO  J   [.&.. .... .... ....] > key(LEFT)  
 [38 1=  LALT >    MOD15^ ] [M:     T:     D:      ]   --  MOD15^
 [38 0=  LALT >    MOD15v ] [M:4000 T:     D:      ]   --  MOD15v
 [17 0=                Iv ] [M:4000 T:     D:      ]   --> {Iv #1}
 [17 1=                I^ ] [M:4000 T:     D:      ]   --> {I^ #0} (tap)
 [38 1=  LALT >    MOD15^ ] [M:     T:     D:      ]   --  MOD15^           

but now ALT-TAB no longer work. I'm not sure how to COMBO ALT-TAB since windows has a different behaviour between switching or holding down ALT-TAB release TAB and using cursor keys with ALT still held.

cajhin commented 8 months ago

your log misses the crucial first line: LALTv --> LALTv

As soon as you press the unmodified LALT, this LALT down is sent to Windows. The following cursor keys that are sent are (as Windows sees it) ALT+Cursor combos, which doesn't work.

Releasing LALT first before sending the cursor doesn't work right either, because then Windows sees an "Alt tapped" which activates the current menu (and other thing).

The way I do it is:

REWIRE LALT MOD9 // LALT
COMBO  J   [...& .... ....] > key(LEFT)

Now Alt is a virtual modifier that does not interact with Windows at all. When I need the real ALT (which is not very often), I either use right ALT, or I can tap+hold the left ALT (press alt, release alt, press alt, then press another key like TAB)

kbilsted commented 8 months ago

I've tried other keymapping projects and at least one of them handles the ALT much better

cajhin commented 8 months ago

which one?

On 19. Mar 2024, at 18:11, Kasper B. Graversen @.***> wrote:

Closed #107 https://github.com/cajhin/capsicain/issues/107 as not planned.

— Reply to this email directly, view it on GitHub https://github.com/cajhin/capsicain/issues/107#event-12172878930, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBEBJQDD5BJIAJIDXID74DYZBWSVAVCNFSM6AAAAABEYGYZISVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJSGE3TEOBXHA4TGMA. You are receiving this because you commented.

kbilsted commented 8 months ago

https://github.com/houmain/keymapper

Aadam-Marshall commented 6 months ago

Keyboard Manager in PowerToys also can work with Alt:

https://github.com/microsoft/PowerToys/wiki/Keyboard-Manager https://learn.microsoft.com/en-us/windows/powertoys/keyboard-manager#remapping-shortcuts