Skip to content

Fixed Remapping failure on heavy load (Re: 9) - #10

Open
LoessCode wants to merge 3 commits into
Zer0codestuff:mainfrom
LoessCode:main
Open

LoessCode wants to merge 3 commits into
Zer0codestuff:mainfrom
LoessCode:main

Conversation

@LoessCode

Copy link
Copy Markdown
Contributor

When playing games, the remapping sometimes fails and the original keypress is used instead.

So for example when button [2] on the side is assigned to [space], pressing it causes the game to receive [2] instead of the assigned [space]
This occurs on bluetooth as it is a software intercept remap.

This issue started occuring on almost every keypress, which made the bindings unusable, so I released a patch for it. tested it and confirmed the issue is fully resolved, you are good to merge.

(new PR as the original one had another bug that is now resolved)

LoessCode and others added 3 commits October 24, 2026 18:54
Over Bluetooth a mapped side button sometimes sent its plain key to the game
instead of the remapped action.

- InputEdgeMatcher kept an edge for only 25 ms measured against the newest
  edge, so a tap callback that ran after the release was recorded found no
  press and passed the native key. Edges are now retained for one second and
  still match within 25 ms of the event's hardware timestamp.
- CorrelatedEdges lets the tap wait up to 20 ms for an edge the HID thread has
  not recorded yet, for mapped controls while the mouse is connected.
- The HID thread runs at user-interactive QoS.
- A tap disabled by the system is logged, and ModifierTrace records waits and
  unmatched mapped-control events without the key.

Tests: 12 new checks. Reported fixed by the user in a game over Bluetooth.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Brings in the PR Zer0codestuff#8 merge commit and the 2.7.0 release. AGENTS.md entries from
both sides are kept.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The 20 ms wait added for leaking remapped keys stalled the blocking tap. It ran
for every key matching a mapped button, including the real keyboard's, and under
game load overran to 80 to 119 ms, which held up mouse movement and clicks in
Rise of the Tomb Raider. The user's trace showed no wait that ever caught a late
mouse edge, so the edge retention fix is what cured the leaks.

- EventTapManager no longer waits for an HID edge.
- CorrelatedEdges only locks the matcher shared by the HID thread and the tap.
- Docs and tests updated.

Reported working in the game by the user.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@LoessCode LoessCode changed the title Fixed Remapping failure on heavy load- #9 Fixed Remapping failure on heavy load (Re: 9) Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant