Merge branch 'show-key-kitten' of https://github.com/page-down/kitty

This commit is contained in:
Kovid Goyal 2022-08-09 11:32:10 +05:30
commit 65a20a2407
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
3 changed files with 14 additions and 4 deletions

View file

@ -34,7 +34,7 @@ def format_mods(mods: int) -> str:
class KeysHandler(Handler):
def initialize(self) -> None:
self.cmd.set_window_title('Kitty extended keyboard protocol demo')
self.cmd.set_window_title('kitty extended keyboard protocol demo')
self.cmd.set_cursor_visible(False)
self.print('Press any keys - Ctrl+C or Ctrl+D will terminate')

View file

@ -62,6 +62,7 @@ def legacy_main() -> None:
kitty extended keyboard protocol.
'''.format
help_text = 'Show the codes generated by the terminal for key presses in various keyboard modes'
usage = ''
def main(args: List[str]) -> None:
@ -80,3 +81,8 @@ def main(args: List[str]) -> None:
if __name__ == '__main__':
main(sys.argv)
elif __name__ == '__doc__':
cd = sys.cli_docs # type: ignore
cd['usage'] = usage
cd['options'] = OPTIONS
cd['help_text'] = help_text

10
kitty/key_encoding.py generated
View file

@ -292,14 +292,18 @@ def as_num(key: str) -> int:
backspace_key = KeyEvent(key='BACKSPACE')
config_mod_map = {
'SHIFT': SHIFT,
'': SHIFT,
'ALT': ALT,
'OPTION': ALT,
'OPT': ALT,
'': ALT,
'': SUPER,
'CMD': SUPER,
'SUPER': SUPER,
'CTRL': CTRL,
'COMMAND': SUPER,
'CMD': SUPER,
'': SUPER,
'CONTROL': CTRL,
'CTRL': CTRL,
'': CTRL,
'HYPER': HYPER,
'META': META,
'NUM_LOCK': NUM_LOCK,