From 8604ed5b784f864825facb81dc2826664ce46aaf Mon Sep 17 00:00:00 2001 From: Kent Friesen Date: Fri, 15 Jan 2021 15:44:46 -0500 Subject: [PATCH] adds ANSI control codes --- pyte/escape.py | 6 ++++++ pyte/screens.py | 6 ++++++ pyte/streams.py | 2 ++ 3 files changed, 14 insertions(+) diff --git a/pyte/escape.py b/pyte/escape.py index dc06b8b..9dfcbc1 100644 --- a/pyte/escape.py +++ b/pyte/escape.py @@ -152,3 +152,9 @@ #: *Horizontal position adjust*: Same as :data:`CHA`. HPA = "'" + +#: *Set Alternate keypad mode*: Not sure what this is. Maybe what it says on the tin? +DECKPAM = "=" + +#: * Set numeric keypad mode*: Undocumented for now. +DECKPNM = ">" diff --git a/pyte/screens.py b/pyte/screens.py index 37dcb48..b093d84 100644 --- a/pyte/screens.py +++ b/pyte/screens.py @@ -607,6 +607,12 @@ def backspace(self): """ self.cursor_back() + def set_alternate_keypad(self): + pass + + def set_numeric_keypad(self): + pass + def save_cursor(self): """Push the current cursor position onto the stack.""" self.savepoints.append(Savepoint(copy.copy(self.cursor), diff --git a/pyte/streams.py b/pyte/streams.py index 5bfd936..f7b6936 100644 --- a/pyte/streams.py +++ b/pyte/streams.py @@ -82,6 +82,8 @@ class Stream(object): esc.HTS: "set_tab_stop", esc.DECSC: "save_cursor", esc.DECRC: "restore_cursor", + esc.DECKPAM: "set_alternate_keypad", + esc.DECKPNM: "set_numeric_keypad", } #: "sharp" escape sequences -- ``ESC # ``.