Add keypad mode support to replay commands

Also name the constants correctly
This commit is contained in:
Kovid Goyal 2020-06-29 12:46:34 +05:30
parent c68516ca8d
commit 025f6d7701
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 12 additions and 4 deletions

View File

@ -34,6 +34,14 @@ def screen_bell() -> None:
pass
def screen_normal_keypad_mode() -> None:
write('\x1b>')
def screen_alternate_keypad_mode() -> None:
write('\x1b=')
def screen_cursor_position(y: int, x: int) -> None:
write(CSI + '%s;%sH' % (y, x))

View File

@ -110,10 +110,10 @@
#define ESC_DECRC '8'
// Set normal keypad mode
#define ESC_DECPNM '>'
#define ESC_DECKPNM '>'
// Set alternate keypad mode
#define ESC_DECPAM '='
#define ESC_DECKPAM '='
// ECMA-48 CSI sequences.
// ---------------------

View File

@ -225,9 +225,9 @@ handle_esc_mode_char(Screen *screen, uint32_t ch, PyObject DUMP_UNUSED *dump_cal
CALL_ED(screen_save_cursor); break;
case ESC_DECRC:
CALL_ED(screen_restore_cursor); break;
case ESC_DECPNM:
case ESC_DECKPNM:
CALL_ED(screen_normal_keypad_mode); break;
case ESC_DECPAM:
case ESC_DECKPAM:
CALL_ED(screen_alternate_keypad_mode); break;
case '%':
case '(':