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

This library should include a disclaimer about the suggested use #50

Open
rogerdahl opened this issue Mar 16, 2020 · 0 comments
Open

This library should include a disclaimer about the suggested use #50

rogerdahl opened this issue Mar 16, 2020 · 0 comments
Labels
wontfix this won't be worked on, feel free to contribute

Comments

@rogerdahl
Copy link

This applies primarily for reading extended keys, such as the arrow keys, F-keys, Page Up/Down, Home, Insert, Delete, and most or all modifier key combinations.

The library is suggesting that the returned escape codes can be used directly for determining which keys were pressed, but that's not the case for Linux.

On Linux, the key escape codes should not be compared with hard coded values. That will only work if the end user's terminal emulator emits the same escape codes as the ones that are being checked against.

There is a list of captured escape codes included in the library and this should not be used for the same reason. It will only work if the end user's terminal emulator is emitting the same codes as the library author's terminal did.

The codes that the Python program will receive on a given user's machine are indicated by the TERM variable, which is usually set by the terminal emulator. Command line programs use the TERM variable to query the terminfo database to find which escape codes to expect for the various keys.

If things don't work as expected, many terminal emulators have settings (maybe under "compatibility"), where the codes can be adjusted to accommodate for programs that assume specific codes, such as this library does, and likely most programs that use it, do.

@Cube707 Cube707 added the wontfix this won't be worked on, feel free to contribute label Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix this won't be worked on, feel free to contribute
Projects
None yet
Development

No branches or pull requests

2 participants