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

@@ -3,7 +3,14 @@
# License: GPL v3 Copyright: 2018, Kovid Goyal <kovid at kovidgoyal.net>
from kitty.fast_data_types import truncate_point_for_length, wcswidth
from kitty.key_encoding import RELEASE, HOME, END, BACKSPACE, DELETE, LEFT, RIGHT
from kitty.key_encoding import RELEASE, K
HOME = K['HOME']
END = K['END']
BACKSPACE = K['BACKSPACE']
DELETE = K['DELETE']
LEFT = K['LEFT']
RIGHT = K['RIGHT']
class LineEdit: