Rémi Bernon (@rbernon) commented about server/queue.c:
unsigned char vkey = input->kbd.vkey; unsigned char hook_vkey = vkey; unsigned int message_code, time;
- lparam_t lparam = input->kbd.scan << 16;
- lparam_t hook_lparam;
Could we keep only hook_vkey as a hook-specific variable?
Something like that:
``` lparam_t lparam = input->kbd.scan << 16; unsigned int flags = 0;
/* ... */
if (input->kbd.flags & KEYEVENTF_UNICODE && !vkey) vkey = hook_vkey = VK_PACKET; else { if (input->kbd.flags & KEYEVENTF_EXTENDEDKEY) flags |= KF_EXTENDED; /* FIXME: set KF_DLGMODE and KF_MENUMODE when needed */ if (input->kbd.flags & KEYEVENTF_KEYUP) flags |= KF_REPEAT | KF_UP; else if (desktop->keystate[vkey] & 0x80) flags |= KF_REPEAT;
lparam &= 0xff0000; /* mask off scan code high bits for non-unicode input */ }
msg->wparam = vkey; msg->lparam = (flags << 16) | lparam | 1 /* repeat count */;
if (!(wait = send_hook_ll_message( desktop, msg, WH_KEYBOARD_LL, lparam | hook_vkey, sender ))) queue_hardware_message( desktop, msg, 1 ); ```
(Or using a `scan` variable, and `(scan << 16)` in place of lparam).