[PR #384] [MERGED] introduce key name aliases #501

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

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/384
Author: @kommander
Created: 12/5/2025
Status: Merged
Merged: 12/5/2025
Merged by: @kommander

Base: mainHead: normalized-key-names


📝 Commits (6)

📊 Changes

10 files changed (+1089 additions, -81 deletions)

View changed files

📝 packages/core/src/lib/keymapping.test.ts (+98 -1)
📝 packages/core/src/lib/keymapping.ts (+28 -1)
📝 packages/core/src/renderables/Input.test.ts (+199 -0)
📝 packages/core/src/renderables/Input.ts (+118 -47)
📝 packages/core/src/renderables/Select.test.ts (+163 -0)
📝 packages/core/src/renderables/Select.ts (+80 -15)
packages/core/src/renderables/TabSelect.test.ts (+188 -0)
📝 packages/core/src/renderables/TabSelect.ts (+72 -14)
📝 packages/core/src/renderables/Textarea.ts (+18 -3)
📝 packages/core/src/renderables/__tests__/Textarea.keybinding.test.ts (+125 -0)

📄 Description

Currently the key parsing only knows about return and linefeed, but in the Textarea you may for example want to allow using the name enter, so an alias allows you to map enter to return and when a keybinding for enter exists it will react to return.


🔄 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/384 **Author:** [@kommander](https://github.com/kommander) **Created:** 12/5/2025 **Status:** ✅ Merged **Merged:** 12/5/2025 **Merged by:** [@kommander](https://github.com/kommander) **Base:** `main` ← **Head:** `normalized-key-names` --- ### 📝 Commits (6) - [`417a07a`](https://github.com/anomalyco/opentui/commit/417a07ab933ed9651fc1da721ec191223f13c84e) introduce key aliases for mapping - [`af82f9b`](https://github.com/anomalyco/opentui/commit/af82f9b901796d3a213d10c4a2839adecd6fb407) bindings for input renderable - [`4c5a862`](https://github.com/anomalyco/opentui/commit/4c5a86228ddbf9b138f9c2f6b98a7f9db929a072) simplify - [`421fa2a`](https://github.com/anomalyco/opentui/commit/421fa2a96b0368f0fb7dabd5fcb7e2da7902f2a1) select - [`08ea93d`](https://github.com/anomalyco/opentui/commit/08ea93d6bbd8ebb5a040d82a403144bb90ff7ca7) tabselect - [`2f7b5ec`](https://github.com/anomalyco/opentui/commit/2f7b5ecb848c7863d0a01f581243285d877fbeb5) fix types ### 📊 Changes **10 files changed** (+1089 additions, -81 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/lib/keymapping.test.ts` (+98 -1) 📝 `packages/core/src/lib/keymapping.ts` (+28 -1) 📝 `packages/core/src/renderables/Input.test.ts` (+199 -0) 📝 `packages/core/src/renderables/Input.ts` (+118 -47) 📝 `packages/core/src/renderables/Select.test.ts` (+163 -0) 📝 `packages/core/src/renderables/Select.ts` (+80 -15) ➕ `packages/core/src/renderables/TabSelect.test.ts` (+188 -0) 📝 `packages/core/src/renderables/TabSelect.ts` (+72 -14) 📝 `packages/core/src/renderables/Textarea.ts` (+18 -3) 📝 `packages/core/src/renderables/__tests__/Textarea.keybinding.test.ts` (+125 -0) </details> ### 📄 Description Currently the key parsing only knows about `return` and `linefeed`, but in the `Textarea` you may for example want to allow using the name `enter`, so an alias allows you to map `enter` to `return` and when a keybinding for `enter` exists it will react to `return`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 23:46:48 +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#501
No description provided.