pyte
pyte copied to clipboard
Add keypad mode escape sequences `DECKPAM` and `DECKPNM`
Resolves #141 Superseeds #142
This PR adds support for DECKPAM and DECKPNM escape sequences, to set keypad mode.
If such escape sequence is found Stream emits Screen.set_keypad_mode(), which sets Screen.keypad_mode flag to one of KeypadMode enum values.
An enumeration is used to provide more expressive values for type checking as a boolean would be able to express.
For applications to correctly check for active keypad mode, KeypadMode class is exported.
Keypad mode is said to be non-persistent and thus reset to numeric mode by reset() event.
Related specification:
- https://vt100.net/docs/vt510-rm/DECKPAM.html
- https://vt100.net/docs/vt510-rm/DECKPNM.html