cajhin / capsicain

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

Weird combo behavior (not working as expected) #87

Closed Lingxi-Li closed 1 year ago

Lingxi-Li commented 1 year ago

Not sure if this is particular to me. Following config should be sufficient to repro on my side.

REWIRE CAPS LSHF CAPS
REWIRE LALT LWIN
REWIRE RSHF LWIN

When I press LALT + CAPS + S, I expect it to trigger WIN + SHF + S which is the shortcut to take a screen clip. Yet, it doesn't work. Weirdly, when I press RSHF + CAPS + S, it works!

I tried debug output. For the combo that does not work, it is like

 [38 0=  LALT >     LWINv ] [M:   4 T:     D:      ]   --  LWINv {LWINv #1}
 [3a 0=  CAPS >     LSHFv ] [M:   5 T:     D:      ]   --  LSHFv {LSHFv #2}
 [38 1=  LALT >     LWIN^ ] [M:   1 T:     D:      ]   --  LWIN^ {LWIN^ #1}
 [38 0=  LALT >     LWINv ] [M:   5 T:     D:      ]   --  LWINv {LWINv #2}
 [38 1=  LALT >     LWIN^ ] [M:   1 T:   4 D:      ]   --  LWIN^ {LWIN^ #1} (tap)
 [3a 1=  CAPS >     LSHF^ ] [M:     T:   4 D:      ]   --  LSHF^ {LSHF^ #0}

Does not make sense and note the missing of S.

For the one that does work, it is like

 [36 0=  RSHF >     LWINv ] [M:   4 T:     D:      ]   --  LWINv {LWINv #1}
 [3a 0=  CAPS >     LSHFv ] [M:   5 T:     D:      ]   --  LSHFv {LSHFv #2}
 [1f 0=                Sv ] [M:   5 T:     D:      ]   --> {Sv #3}
 [1f 1=                S^ ] [M:   5 T:     D:      ]   --> {S^ #2} (tap)
 [36 1=  RSHF >     LWIN^ ] [M:   1 T:     D:      ]   --  LWIN^ {LWIN^ #1}
 [3a 1=  CAPS >     LSHF^ ] [M:     T:     D:      ]   --  LSHF^ {LSHF^ #0}

Maybe, this is an issue with my keyboard? I'm using Microsoft Sculpt Ergonomic Keyboard BTW.

Lingxi-Li commented 1 year ago

Also I have all options turned off.

OPTIONs
off:     debug output for each key event
off:     Z <-> Y
off:     Alt <-> Win for Apple keyboards
off:     Left Control and Win block alpha key mapping ('Ctrl + C is never changed')
off:     Process only the keyboard that sent the first key
cajhin commented 1 year ago

Could possibly be "ghosting or shadowing" (google it, basically not all keyboards can process all combos of keys. Check out n-key rollover if you want to have a capable keyboard).

If it is shadowing, the "hardware issue" is probably that Caps and S are on the same row, and LAlt and S are on the same column. To test the theory, try O instead of S

Update: this is a cool test page from microsoft, try it https://www.microsoft.com/applied-sciences/projects/anti-ghosting-demo

Lingxi-Li commented 1 year ago

Thanks for the info. Looks like it is the root cause.