cafali / SnapKey

SnapKey provides a user-friendly Razer Snap Tap/SOCD alternative, making it accessible across all keyboards!
https://github.com/cafali/SnapKey/wiki
MIT License
233 stars 13 forks source link

Setting Custom Keys Makes SnapKey Only Work In One Direction #44

Closed Comoner closed 1 month ago

Comoner commented 1 month ago

I use DVORAK keyboard and set the keys as follows :

key1=65 key2=69

For A and E keys respectively since in DVORAK the D key is replaced by the E key.

With these settings, SnapKey works fine when you keep Strafe Left(A) pressed down then press down on the Strafe Right(E) at the same time.

However, you stop movement in game as if SnapKey were not running when you keep Strafe Right(E) pressed down then press down on Straffe Left(A).

cafali commented 1 month ago

"movement in game" what game exactly? Your config is correct for the DVORAK keyboard (left/right keys).

Comoner commented 1 month ago

I was just testing out SnapKey in New World. It works fine with default settings for A and D keys. Only if I modify the config for key assignment does it fail in one direction. I'm just switching between QWERTY and DVORAK through Windows Keyboard Language.

cafali commented 1 month ago

There are no issues with rebinding the keys in the code. Make sure to restart Snapkey after changing the key bindings. Also, ensure that the game itself does not have a preferred layout (e.g., QWERTY); some games use a global keyboard layout for input methods. (also notice that New World is on a custom in-house game engine(might not support a standard input method))

CS2 fixed this issue a while ago:

image

When you rebind the keys and switch the layout to DVORAK/QWERTY, make sure to test it here: https://drakeirving.github.io/MultiKeyDisplay/

I use two keyboard layouts in Windows myself, and I know it works fine.

you can also create 2 groups for A/D and A/E key1=65 key2=69 key3=65 key4=68

Comoner commented 1 month ago

You had the same idea as I did. On the site you gave me it works fine in DVORAK. I did initially try it on this different site though :

en.key-test.ru

And here it exhibits strange behavior in DVORAK. When I keep A down and press E, it shows D being pressed down and A released. But when I press E then A, it initially shows D pressed down. Then when I press A, it shows D still pressed down then suddenly E gets pressed down then released. Then even when I let go of D, E still seems to be pressed down. I believe it is some weird interaction with how the key presses are detected by the program and the Windows Keyboard Language software.

Comoner commented 1 month ago

As a side note, the settings you provided here :

key1=65 key2=69 key3=65 key4=68

Does not seem to work as intended. It works for key1 and key2 but not for key3 and key4 which behaves as though SnapKey were not running. This is probably because there is a duplicate Key for 65. It does not work when switching between QWERTY and DVORAK nor does it work when you just press the corresponding keys on just one of the keyboard layouts.

cafali commented 1 month ago

Both QWERTY and DVORAk layouts work fine for me in CS2 with the right ASCII codes. However, if you switch the keyboard layout mid-game (using Win+Space) from Dvorak to QWERTY, it messes things up because the keybinds and keycodes in the config file are tied to the layout set in the config. I’m not going to fix this—who actually switches layouts while playing? Just stick to one layout while gaming, seriously.