Open devnguy opened 2 years ago
Interesting. I haven't tested this configuration, so I assume that what happens depends on the order in which that different remapping softwares handle the keys. I can take a look.
PowerToys use 0x101 as INJECTION KEY. So, add or modify the key in dual-key-remap.c
LRESULT CALLBACK keyboard_callback(int msg_code, WPARAM w_param, LPARAM l_param) { int block_input = 0;
// Per MS docs we should only act for HC_ACTION's
if (msg_code == HC_ACTION) {
KBDLLHOOKSTRUCT * data = (KBDLLHOOKSTRUCT *)l_param;
enum Direction direction = (w_param == WM_KEYDOWN || w_param == WM_SYSKEYDOWN)
? DOWN
: UP;
//int is_injected = data->dwExtraInfo == INJECTED_KEY_ID;
int is_injected = (data->dwExtraInfo == INJECTED_KEY_ID || data->dwExtraInfo == POWER_TOYS_INJECTED_KEY_ID);
.... }
and recompile dual-key-remap !
Limitation: Should excute dual-key-remap.exe AFTER PowerToys running.
PS:
LRESULT CALLBACK _keyboardcallback(int msg_code, WPARAM w_param, LPARAM l_param) { .... return (block_input) ? 1 : CallNextHookEx(g_mouse_hook, msg_code, w_param, l_param); } I think this line needs to be fixed with <g_keyboard_hook>.
Hi,
I remapped my left alt key to left control and vice versa through Windows PowerToys. Now when using this project and pressing caps lock with other keys, it looks like alt is being registered instead of control.
Desired behavior: CTRL when pressed with other keys Observed behavior: ALT when pressed with other keys
I've tried these configs, but all have the same result
Is this project expected to work after remapping the control key through some other program?