This commit is contained in:
Kovid Goyal
2021-10-12 07:41:52 +05:30
parent 97a8ff3478
commit da3f34603a
2 changed files with 15 additions and 10 deletions
+5
View File
@@ -228,6 +228,11 @@ class KeyEvent(NamedTuple):
return True
return False
def matches_text(self, text: str, case_sensitive: bool = False) -> bool:
if case_sensitive:
return self.text == text
return self.text.lower() == text.lower()
@property
def mods_without_locks(self) -> int:
return self.mods & ~(NUM_LOCK | CAPS_LOCK)