Skip to content
This repository has been archived by the owner on Dec 17, 2023. It is now read-only.

provide robust keyboard input handling in terminal apps #1

Open
nazmulidris opened this issue Dec 30, 2021 · 0 comments
Open

provide robust keyboard input handling in terminal apps #1

nazmulidris opened this issue Dec 30, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@nazmulidris
Copy link
Member

nazmulidris commented Dec 30, 2021

Currently Node.js and Ink have limitations (that are largely derived from the limitations of Node.js itself). Here are some keyboard shortcuts that don't work in a terminal:

  • Shift
  • Shift+Enter
  • Shift+Shift
  • Shift+0..9

Similarly if you replace Shift w/ Ctrl, etc. it won't work either.

Here's a source file (experiment) that goes into this in great detail: https://github.com/r3bl-org/r3bl-cmdr/blob/c506056d78791fc2ac290542fd874fa54eb20315/src/experimental/nodejs-keypress/nodejs-keypress-readline.ts

Iohook is an example of this (although it isn't supported for newer Node versions). https://github.com/wilix-team/iohook

The task is to replicate Iohook like functionality in Rust and provide it w/ r3bl-cmdr. The keyboard handling code in r3bl-ts-utils is currently compatible w/ Node.js, Ink, and it should also be compatible w/ this native Rust implementation (whenever it is ready).

@nazmulidris nazmulidris self-assigned this Dec 30, 2021
@nazmulidris nazmulidris added the enhancement New feature or request label Dec 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant