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

@@ -8,7 +8,7 @@ import sys
from kitty.cli import parse_args
from kitty.cmds import cmap, parse_subcommand_cli
from kitty.constants import version
from kitty.key_encoding import CTRL, ESCAPE, RELEASE, N, S, T, W
from kitty.key_encoding import CTRL, RELEASE, K
from kitty.remote_control import encode_send, parse_rc_args
from ..tui.handler import Handler
@@ -16,6 +16,11 @@ from ..tui.loop import Loop
from ..tui.operations import styled
global_opts = None
ESCAPE = K['ESCAPE']
N = K['N']
S = K['S']
T = K['T']
W = K['W']
class Resize(Handler):