Skip to main content

uncurses/ansi/
keypad.rs

1//! Keypad application and numeric mode selectors.
2//!
3//! ## Category
4//!
5//! These short ESC sequences switch the numeric keypad between application mode
6//! and numeric mode.
7//!
8//! ## Escape format
9//!
10//! The controls are not CSI sequences: application mode is `ESC =`, and numeric
11//! mode is `ESC >`.
12//!
13//! ## Mode interaction
14//!
15//! The same state is commonly described as DEC numeric keypad mode
16//! ([`Mode::NUMERIC_KEYPAD`](crate::ansi::mode::Mode::NUMERIC_KEYPAD), private
17//! mode 66). These constants provide the traditional DECKPAM/DECKPNM byte forms.
18
19/// Keypad Application Mode (DECKPAM): exact bytes `ESC =` (`b"\x1b="`).
20///
21/// After this, keypad keys normally send application sequences instead of digits/operators.
22pub const KEYPAD_APPLICATION_MODE: &[u8] = b"\x1b=";
23
24/// Keypad Numeric Mode (DECKPNM): exact bytes `ESC >` (`b"\x1b>"`).
25///
26/// After this, keypad keys normally send numeric characters and operators.
27pub const KEYPAD_NUMERIC_MODE: &[u8] = b"\x1b>";