SnosMe / uiohook-napi

MIT License
162 stars 37 forks source link

Right Alt seems to be replaced with Alt on tap / toggle #22

Open caderek opened 1 year ago

caderek commented 1 year ago

Hi, thanks for a great lib.

I have one problem - when I send a right alt key, the lib seems to ignore the distinction between left and right alt and treat it as the same key (left alt). That's a problem, because it makes it impossible to type some special characters that work only with the right alt.

Am I missing something?

Example:

uIOhook.keyToggle(UiohookKey.AltRight, "down");
uIOhook.keyTap(UiohookKey[5]);
uIOhook.keyToggle(UiohookKey.AltRight, "up");

Should type a sign, but instead triggers whatever is assigned to LeftAlt+5 (for example, goes to the fifth the tab in a browser).

Please let me know if there is a way to achieve that in the current version.

SnosMe commented 1 year ago

Seems like a bug in https://github.com/kwhat/libuiohook


I pass keycodes without any modifications straight to lib

https://github.com/SnosMe/uiohook-napi/blob/63745a540828de230392eee3e6cf85d8a4d09e13/src/index.ts#L188-L189

https://github.com/SnosMe/uiohook-napi/blob/63745a540828de230392eee3e6cf85d8a4d09e13/src/lib/addon.c#L298-L300