-
Notifications
You must be signed in to change notification settings - Fork 40
Description
Hi @TolikPylypchuk,
I have an update regarding this issue. I was able to reproduce the behavior on a Linux system using SimpleGlobalHook.
Key Findings:
Frequency: The issue appears more frequently when using SimpleGlobalHook() compared to TaskPoolGlobalHook.
Lag vs. Loss: I discovered that the events are not actually "lost," but rather severely lagged. The events seem to be buffered or blocked somewhere in the processing chain for several minutes.
Specific Test Scenario:
Here is the timeline from my recent test where the issue occurred:11:07 AM: The system was being actively used (mouse and keyboard), but no logs were received from SharpHook.
11:12 AM: To test, I pressed the key P 5 times. No events were captured at that moment.
11:13 AM: I pressed the key Q 2 times. Still no events were captured.
11:17 AM: Suddenly, a flood of events appeared in the logs. This included the specific P and Q key presses from earlier, as well as the backlog of mouse/keyboard activity starting from 11:07 AM.
The below logs confirm that events pressed at 11:12-11:13 AM were not logged until 11:17 AM (approximately 4-5 minutes delay). Additionally, you can see that the order of events is incorrect — I pressed P 5 times first and then Q 2 times, but the logs show Q events appearing before some of the P events.
logs:[03-12-2025 11:17:10] info : LH:dispatch_key_press [166]: Key 0X51 typed. (q) [03-12-2025 11:17:10] info : LH:dispatch_key_press [166]: Key 0X51 typed. (q) [03-12-2025 11:17:10] info : LH:dispatch_key_press [166]: Key 0X50 typed. (p) [03-12-2025 11:17:10] info : LH:dispatch_key_press [166]: Key 0X50 typed. (p) [03-12-2025 11:17:10] info : LH:dispatch_key_press [166]: Key 0X50 typed. (p) [03-12-2025 11:17:12] info : LH:dispatch_key_press [166]: Key 0X50 typed. (p) [03-12-2025 11:22:32] info : LH:dispatch_key_press [166]: Key 0X50 typed. (p)System Configuration for Reproduction:
I was able to reproduce this on the following Linux environment:OS: Ubuntu 18.04.6 LTS (Bionic Beaver)
Kernel: 5.4.0-150-generic x86_64
CPU: Intel Pentium G4400 @ 3.30GHz
RAM: ~8 GB
Graphics: Intel HD Graphics 510 (Driver: i915)
Motherboard: Gigabyte H110M-S2I have attached the full logs covering the period from 10:54 AM to 11:23 AM for your reference.
Idle Period: The system was legitimately idle from 10:55 AM to 11:07 AM.
Issue Onset: From 11:07 AM onwards, active mouse and keyboard usage resumed, but no SharpHook events were recorded at that time.These logs demonstrate the delayed event behavior described above. If you would like me to perform any specific tests or provide further details to assist with debugging, please let me know.