Implement the extended keyboard protocol

This commit is contained in:
Kovid Goyal
2017-02-10 15:11:07 +05:30
parent 45334d6b35
commit 0f8b83755a
5 changed files with 207 additions and 173 deletions

View File

@@ -37,15 +37,15 @@ if raw != nraw:
raw = subprocess.check_output([
'kitty', '-c',
'from kitty.keys import *; import json; print(json.dumps(key_integer_map()))'
'from kitty.keys import *; import json; print(json.dumps(key_extended_map))'
]).decode('utf-8')
key_map = json.loads(raw)
lines = [
'See link:protocol-extensions.asciidoc#keyboard-handling[Keyboard Handling protocol extension]',
'', '|===', '| Name | Number', ''
'', '|===', '| Name | Encoded representation', ''
]
for k in sorted(key_map):
lines.append('| {:15s} | {}'.format(k.replace('_', ' '), key_map[k]))
lines.append('| {:15s} | `{}`'.format(k.replace('_', ' '), key_map[k]))
lines += ['', '|===']
with open('key_encoding.asciidoc', 'w') as f:
print('= Key encoding for extended keyboard protocol\n', file=f)