Refactor key encoding

Cannot have key names in global namespace as not all key names are valid
python identifiers. So move them into a dict.
This commit is contained in:
Kovid Goyal
2020-03-03 14:54:30 +05:30
parent 64b497589f
commit 8843ded1c9
7 changed files with 37 additions and 12 deletions

View File

@@ -19,8 +19,8 @@ from kitty.fast_data_types import (
close_tty, normal_tty, open_tty, parse_input_from_terminal, raw_tty
)
from kitty.key_encoding import (
ALT, CTRL, PRESS, RELEASE, REPEAT, SHIFT, C, D, backspace_key,
decode_key_event, enter_key
ALT, CTRL, PRESS, RELEASE, REPEAT, SHIFT, backspace_key,
decode_key_event, enter_key, K
)
from kitty.utils import screen_size_function, write_all
@@ -28,6 +28,9 @@ from .handler import Handler
from .operations import init_state, reset_state
C, D = K['C'], K['D']
def debug(*a, **kw):
from base64 import standard_b64encode
buf = io.StringIO()