mirror of
https://github.com/anomalyco/opentui.git
synced 2026-04-25 13:06:00 +03:00
[PR #527] [CLOSED] fix: map keypad keys to printable characters in Kitty keyboard protocol #1381
Labels
No labels
bug
core
documentation
feature
good first issue
help wanted
pull-request
question
react
solid
tmux
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/opentui#1381
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/anomalyco/opentui/pull/527
Author: @alpacachen
Created: 1/15/2026
Status: ❌ Closed
Base:
main← Head:fix/keypad-characters📝 Commits (1)
627fa15fix: map keypad keys to printable characters in Kitty keyboard protocol📊 Changes
2 files changed (+85 additions, -12 deletions)
View changed files
📝
packages/core/src/lib/parse.keypress-kitty.test.ts(+47 -0)📝
packages/core/src/lib/parse.keypress-kitty.ts(+38 -12)📄 Description
Summary
Problem
When using Kitty keyboard protocol, keypad keys are correctly identified with names like
kp0,kp1,kpplus, etc., but thesequencefield doesn't contain the corresponding printable character. This causes input fields (textarea, input) to not accept keypad input since they rely on the sequence to insert text.For example:
1produces:name="1",sequence="1"✓1produces:name="kp1",sequence="\x1b[57401u"✗ (should be"1")Solution
Added a
keypadCharMapto convert keypad key names to their printable character equivalents:kp0-kp9→"0"-"9"kpplus→"+"kpminus→"-"kpmultiply→"*"kpdivide→"/"kpdecimal→"."kpequal→"="Note:
kpenteris intentionally NOT mapped since it should behave like the return key, not insert a character.Testing
Added test cases to verify keypad keys produce the correct characters in their sequence field.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.