Skip to content

Conversation

deathaxe
Copy link
Contributor

@deathaxe deathaxe commented Apr 18, 2025

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:

@deathaxe deathaxe force-pushed the feat/keypad-modes branch from 170e767 to 3b886e0 Compare April 18, 2025 12:49
This commit 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.

Related specification:
- https://vt100.net/docs/vt510-rm/DECKPAM.html
- https://vt100.net/docs/vt510-rm/DECKPNM.html
@deathaxe deathaxe force-pushed the feat/keypad-modes branch from 3b886e0 to fc70a87 Compare April 22, 2025 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing the '=' and '>' control codes

1 participant