You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 theTERM
variable to query theterminfo
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.
The text was updated successfully, but these errors were encountered: