themes kitten: fix some keybaord shortcuts not working with weird IME systems on Linux that convert key events into text events

This commit is contained in:
Kovid Goyal
2024-10-15 09:51:52 +05:30
parent a81fd3b1c2
commit 62d5e13cbd
2 changed files with 24 additions and 10 deletions

View File

@@ -306,6 +306,20 @@ func (self *KeyEvent) MatchesPressOrRepeat(spec string) bool {
return self.MatchesParsedShortcut(ParseShortcut(spec), PRESS|REPEAT)
}
func (self *KeyEvent) MatchesCaseSensitiveTextOrKey(spec string) bool {
if self.MatchesParsedShortcut(ParseShortcut(spec), PRESS|REPEAT) {
return true
}
return self.Text == spec
}
func (self *KeyEvent) MatchesCaseInsensitiveTextOrKey(spec string) bool {
if self.MatchesParsedShortcut(ParseShortcut(spec), PRESS|REPEAT) {
return true
}
return strings.ToLower(self.Text) == strings.ToLower(spec)
}
func (self *KeyEvent) MatchesRelease(spec string) bool {
return self.MatchesParsedShortcut(ParseShortcut(spec), RELEASE)
}