testing some new key translation
parent
b19215a3b6
commit
a01cb9ee6e
|
@ -223,6 +223,11 @@ colormap = [
|
||||||
("60", "light magenta", "default")
|
("60", "light magenta", "default")
|
||||||
]
|
]
|
||||||
|
|
||||||
|
escape_map = {
|
||||||
|
key: urwid.vterm.ESC + sequence
|
||||||
|
for sequence, key in urwid.escape.input_sequences
|
||||||
|
}
|
||||||
|
|
||||||
rcpath = os.path.join(os.getenv("HOME"), ".bbjrc")
|
rcpath = os.path.join(os.getenv("HOME"), ".bbjrc")
|
||||||
markpath = os.path.join(os.getenv("HOME"), ".bbjmarks")
|
markpath = os.path.join(os.getenv("HOME"), ".bbjmarks")
|
||||||
|
|
||||||
|
@ -1567,18 +1572,22 @@ class ExternalEditor(urwid.Terminal):
|
||||||
elif keyl == "ctrl z":
|
elif keyl == "ctrl z":
|
||||||
return os.killpg(os.getpgid(os.getpid()), 19)
|
return os.killpg(os.getpgid(os.getpid()), 19)
|
||||||
|
|
||||||
if key.startswith("ctrl "):
|
single_char = len(key) == 6
|
||||||
|
if key.startswith("ctrl ") and single_char:
|
||||||
if key[-1].islower():
|
if key[-1].islower():
|
||||||
key = chr(ord(key[-1]) - ord('a') + 1)
|
key = chr(ord(key[-1]) - ord("a") + 1)
|
||||||
else:
|
else:
|
||||||
key = chr(ord(key[-1]) - ord('A') + 1)
|
key = chr(ord(key[-1]) - ord("A") + 1)
|
||||||
else:
|
|
||||||
if self.term_modes.keys_decckm and key in urwid.vterm.KEY_TRANSLATIONS_DECCKM:
|
elif key.startswith("meta ") and single_char:
|
||||||
key = urwid.vterm.KEY_TRANSLATIONS_DECCKM.get(key)
|
key = urwid.vterm.ESC + key[-1]
|
||||||
else:
|
|
||||||
key = urwid.vterm.KEY_TRANSLATIONS.get(key, key)
|
elif key in urwid.vterm.KEY_TRANSLATIONS:
|
||||||
|
key = urwid.vterm.KEY_TRANSLATIONS[key]
|
||||||
|
|
||||||
|
elif key in escape_map:
|
||||||
|
key = escape_map[key]
|
||||||
|
|
||||||
# ENTER transmits both a carriage return and linefeed in LF/NL mode.
|
|
||||||
if self.term_modes.lfnl and key == "\x0d":
|
if self.term_modes.lfnl and key == "\x0d":
|
||||||
key += "\x0a"
|
key += "\x0a"
|
||||||
|
|
||||||
|
@ -1714,16 +1723,6 @@ class ActionBox(urwid.ListBox):
|
||||||
elif keyl == "ctrl r":
|
elif keyl == "ctrl r":
|
||||||
app.reply(None, message)
|
app.reply(None, message)
|
||||||
|
|
||||||
# elif keyl == '"':
|
|
||||||
# quotes = app.get_quotes(message)
|
|
||||||
# if quotes:
|
|
||||||
# app.quote_view_menu(None, quotes)
|
|
||||||
# else:
|
|
||||||
# app.temp_footer_message("This message has no quotes.")
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def frilly_exit():
|
def frilly_exit():
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue