Rémi Bernon (@rbernon) commented about server/queue.c:
msg->lparam = (flags << 16) | lparam | 1u /* repeat count */; if (!(wait = send_hook_ll_message( desktop, msg, WH_KEYBOARD_LL, lparam | hook_vkey, sender )))
- { queue_hardware_message( desktop, msg, 1 );
if (origin == IMO_HARDWARE && vkey != VK_PACKET)
Doing this inside the `!wait`, you will only trigger repetition when there is no LL-hook registered. I'm not completely sure how this should work but maybe you can ignore LL-hooks processing entirely for this, and handle the repetition unconditionally at the end of `queue_keyboard_message`.
Otherwise, and if we need it to be conditioned to LL-hook processing, it would need to be moved somehow inside `queue_hardware_message`, which gets called from `store_message_result` when the last LL-hook have completed their processing.
The latter seems more complicated, and I'm not sure it's necessary. That could be subject to some testing, but LL-hook on modern Windows are very unreliable and are often bypassed (for instance when they are taking "too long" to process). For that reason I think we can probably ignore them for now.