ililim / dual-key-remap

Remap any key to any other two keys on Windows 🔥. Remap CapsLock to both Ctrl and Escape! (It's like xcape for windows!)
GNU General Public License v2.0
512 stars 36 forks source link

Missing KEYEVENTF_EXTENDEDKEY bit on dwFlags for SendInput. Key such … #47

Closed ulixxe closed 2 years ago

ulixxe commented 2 years ago

…as RIGHT_CTRL (scancode=0xE01D) needs it.

ililim commented 2 years ago

Thanks for this patch!

Do we need to handle more than just 0xE0? Which codes? We probably should move this into the key configuration somehow and list all the codes that require KEYEVENTF_EXTENDEDKEY there.

ililim commented 2 years ago

I'm reading through https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-keybd_event?redirectedfrom=MSDN but it's relatively sparse on details.

Sounds like we just need to pass this flag for every scan code that starts with 0xE0?

ulixxe commented 2 years ago

I think to test 0xE0 is enough. I checked it with Keyboard Test Utility by Javad Taheri. With this pull request Right Control is correctly recognized.

ulixxe commented 2 years ago

My use case is BigCtrl (https://github.com/benhansenslc/BigCtrl), where I map the space bar (when_alone=remap_key) to the right control event (with_other) when pressed together with other keys. Using the right control event, I have the left control key for windows default hotkeys such as copy&paste Ctrl-C and Ctrl-V. Furthermore, I use ewow (https://github.com/zk-phi/ewow) to remap with Autohotkey the right control events to emulate Emacs hotkeys in windows applications. To have this setup working, I need this pull request. Otherwise, Autohotkey doesn't capture the right control events.

ililim commented 2 years ago

Hey I just noticed some other changes were made on this branch. Could you just have one set of changes in this PR? Happy to consider other changes in additional PR's :)