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

@@ -17,7 +17,7 @@ from gettext import gettext as _
from kitty.cli import CONFIG_HELP, parse_args
from kitty.constants import appname
from kitty.fast_data_types import wcswidth
from kitty.key_encoding import ESCAPE, RELEASE, enter_key
from kitty.key_encoding import K, RELEASE, enter_key
from ..tui.handler import Handler
from ..tui.images import ImageManager
@@ -40,6 +40,7 @@ except ImportError:
INITIALIZING, COLLECTED, DIFFED, COMMAND, MESSAGE = range(5)
ESCAPE = K['ESCAPE']
def generate_diff(collection, context):