mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-19 06:54:58 +02:00
Unicode input kitten: Fix a regression in 0.20.0 that broke keyboard handling when the num lock or caps lock modifiers were engaged.
Fixes #3587
This commit is contained in:
10
kitty/key_encoding.py
generated
10
kitty/key_encoding.py
generated
@@ -216,7 +216,7 @@ class KeyEvent(NamedTuple):
|
||||
num_lock: bool = False
|
||||
|
||||
def matches(self, spec: Union[str, ParsedShortcut], types: int = EventType.PRESS | EventType.REPEAT) -> bool:
|
||||
mods = self.mods & ~(NUM_LOCK | CAPS_LOCK)
|
||||
mods = self.mods_without_locks
|
||||
if not self.type & types:
|
||||
return False
|
||||
if isinstance(spec, str):
|
||||
@@ -228,6 +228,14 @@ class KeyEvent(NamedTuple):
|
||||
return True
|
||||
return False
|
||||
|
||||
@property
|
||||
def mods_without_locks(self) -> int:
|
||||
return self.mods & ~(NUM_LOCK | CAPS_LOCK)
|
||||
|
||||
@property
|
||||
def has_mods(self) -> bool:
|
||||
return bool(self.mods_without_locks)
|
||||
|
||||
def as_window_system_event(self) -> WindowSystemKeyEvent:
|
||||
action = defines.GLFW_PRESS
|
||||
if self.type is EventType.REPEAT:
|
||||
|
||||
Reference in New Issue
Block a user