Skip to content

fix: prevent double character input on Android Shift+key#65

Merged
Ark0N merged 1 commit intoArk0N:masterfrom
aakhter:fix/android-shift-double-char
Apr 18, 2026
Merged

fix: prevent double character input on Android Shift+key#65
Ark0N merged 1 commit intoArk0N:masterfrom
aakhter:fix/android-shift-double-char

Conversation

@aakhter
Copy link
Copy Markdown
Contributor

@aakhter aakhter commented Apr 12, 2026

Summary

On Android tablets, pressing Shift+A produces "AA" because the input event listener re-sends characters that xterm.js already processed via its keydown handler.

Fix

Track lastKeydownHandled timestamps on the xterm textarea. The input event handler skips if a keydown was processed within 50ms, preventing the double-send while still catching Android virtual keyboard symbols (keyCode 229) that xterm misses.

Only affects touch devices (listener gated by isTouchDevice()).

Test plan

  • On Android tablet: Shift+A produces single "A" (not "AA")
  • Virtual keyboard symbols (/, @, etc.) still work on Android
  • Desktop input unaffected (listener only active on touch devices)

On Android tablets, pressing Shift+A produces "AA" because the input
event listener re-sends characters that xterm already processed via
its keydown handler. Track keydown timestamps and skip input events
that fire within 50ms of a handled keydown.

Only affects touch devices (listener gated by isTouchDevice()).
@Ark0N Ark0N merged commit 34fb5e4 into Ark0N:master Apr 18, 2026
1 check passed
Ark0N added a commit that referenced this pull request Apr 18, 2026
Reflect changes from PRs #65#68: bumped route/SSE counts, added
Ctrl+Shift+{/} (tab reorder), Alt+1-9 (tab switch), Ctrl+Shift+V
(voice), and POST /api/clipboard to the keyboard and API references.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

2 participants