[PR #632] [MERGED] fix(keyboard): correct kitty numpad key code mappings #672

Closed
opened 2026-03-02 23:47:37 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/632
Author: @eyenalxai
Created: 2/5/2026
Status: Merged
Merged: 2/5/2026
Merged by: @kommander

Base: mainHead: main


📝 Commits (2)

  • 2696024 fix(keyboard): correct kitty numpad key code mappings
  • 7237c79 test: update keypad test codes to match fixed mapping

📊 Changes

3 files changed (+31 additions, -31 deletions)

View changed files

📝 packages/core/src/lib/parse.keypress-kitty.test.ts (+12 -12)
📝 packages/core/src/lib/parse.keypress-kitty.ts (+17 -17)
📝 packages/core/src/tests/renderer.input.test.ts (+2 -2)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opentui/pull/632 **Author:** [@eyenalxai](https://github.com/eyenalxai) **Created:** 2/5/2026 **Status:** ✅ Merged **Merged:** 2/5/2026 **Merged by:** [@kommander](https://github.com/kommander) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (2) - [`2696024`](https://github.com/anomalyco/opentui/commit/2696024e0a89059ee2b31a2d0c6367cb2e2d7763) fix(keyboard): correct kitty numpad key code mappings - [`7237c79`](https://github.com/anomalyco/opentui/commit/7237c790e2e9be4d3e55bdd57864dc99e31d3f9d) test: update keypad test codes to match fixed mapping ### 📊 Changes **3 files changed** (+31 additions, -31 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/lib/parse.keypress-kitty.test.ts` (+12 -12) 📝 `packages/core/src/lib/parse.keypress-kitty.ts` (+17 -17) 📝 `packages/core/src/tests/renderer.input.test.ts` (+2 -2) </details> ### 📄 Description fix off-by-one error in kitty keyboard protocol numpad key mappings. according to [kitty documentation](https://sw.kovidgoyal.net/kitty/keyboard-protocol/), 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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 23:47:37 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#672
No description provided.