Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESC doesn't work on its own on posix #94

Open
Cube707 opened this issue Sep 29, 2022 · 1 comment
Open

ESC doesn't work on its own on posix #94

Cube707 opened this issue Sep 29, 2022 · 1 comment
Labels
wontfix this won't be worked on, feel free to contribute

Comments

@Cube707
Copy link
Collaborator

Cube707 commented Sep 29, 2022

Pressing the ESC key on posix systems will not be returned by readkey().

This is expected as it, as the name implies, escapes the next char. It is used to mark longer sequence of multiple keys. readchar can't know the difference if it stems from a single press of ESC or if it is the beginning of a longer sequence.

Use readchar() instead, which correctly returnes every charater seperatly (but you have to handle multiple char-keys yourself, ARROWS, etc..)

@Cube707
Copy link
Collaborator Author

Cube707 commented Sep 29, 2022

One option would be to implement a timeout on reads. This would require #92 to be merged and enable non-blocking reads, so that a timer could be checked again in parallel to waiting for the next char

@Cube707 Cube707 added the wontfix this won't be worked on, feel free to contribute label Sep 29, 2022
Repository owner locked and limited conversation to collaborators Nov 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
wontfix this won't be worked on, feel free to contribute
Projects
None yet
Development

No branches or pull requests

1 participant