Skip to content

fix(keyboard): correct kitty numpad key code mappings#632

Merged
kommander merged 2 commits intoanomalyco:mainfrom
eyenalxai:main
Feb 5, 2026
Merged

fix(keyboard): correct kitty numpad key code mappings#632
kommander merged 2 commits intoanomalyco:mainfrom
eyenalxai:main

Conversation

@eyenalxai
Copy link
Contributor

fix off-by-one error in kitty keyboard protocol numpad key mappings.

according to kitty documentation, the numpad key codes start at 57399 for kp0.

the previous mapping started at 57400, causing all keys to be off by one.
this meant pressing numpad 2 (code 57401) would incorrectly report as kp1.

changes:
shifted all keypad codes down by 1 to match kitty spec.
updated tests with correct key codes.

bun test packages/core/src/lib/parse.keypress-kitty.test.ts passes

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 5, 2026

@opentui/core

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core@7237c79

@opentui/react

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/react@7237c79

@opentui/solid

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/solid@7237c79

@opentui/core-darwin-arm64

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core-darwin-arm64@7237c79

@opentui/core-darwin-x64

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core-darwin-x64@7237c79

@opentui/core-linux-arm64

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core-linux-arm64@7237c79

@opentui/core-linux-x64

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core-linux-x64@7237c79

@opentui/core-win32-arm64

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core-win32-arm64@7237c79

@opentui/core-win32-x64

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core-win32-x64@7237c79

commit: 7237c79

simonklee
simonklee previously approved these changes Feb 5, 2026
Copy link
Collaborator

@simonklee simonklee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@eyenalxai
Copy link
Contributor Author

1 tests failed:
(fail) Kitty keyboard keypad keys via keyInput events [21.85ms]

oops missed this one brb

@kommander kommander merged commit fc48f2c into anomalyco:main Feb 5, 2026
6 checks passed
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.

3 participants