Add NumLock and CapsLock reporting to the keyboard protocol

This commit is contained in:
Kovid Goyal
2021-04-13 07:10:00 +05:30
parent c989a7198b
commit 4c644b8556
9 changed files with 62 additions and 27 deletions

View File

@@ -6,8 +6,8 @@ import sys
from typing import List
from kitty.key_encoding import (
ALT, CTRL, PRESS, RELEASE, REPEAT, SHIFT, SUPER, HYPER, META, KeyEvent,
encode_key_event
ALT, CAPS_LOCK, CTRL, HYPER, META, NUM_LOCK, PRESS, RELEASE, REPEAT, SHIFT,
SUPER, KeyEvent, encode_key_event
)
from ..tui.handler import Handler
@@ -34,7 +34,10 @@ class KeysHandler(Handler):
CTRL: 'Ctrl',
SUPER: 'Super',
HYPER: 'Hyper',
META: 'Meta'}.items():
META: 'Meta',
NUM_LOCK: 'NumLock',
CAPS_LOCK: 'CapsLock',
}.items():
if key_event.mods & m:
lmods.append(name)
mods = '+'.join(lmods)