mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-08 21:25:32 +02:00
Indicate when caps lock is on while reading password
This commit is contained in:
@@ -93,6 +93,10 @@ func (self KeyModifiers) String() string {
|
||||
return strings.Join(ans, "+")
|
||||
}
|
||||
|
||||
func (self KeyModifiers) HasCapsLock() bool {
|
||||
return self&CAPS_LOCK != 0
|
||||
}
|
||||
|
||||
type KeyEvent struct {
|
||||
Type KeyEventType
|
||||
Mods KeyModifiers
|
||||
@@ -121,6 +125,10 @@ func (self *KeyEvent) String() string {
|
||||
return ans + "}"
|
||||
}
|
||||
|
||||
func (self *KeyEvent) HasCapsLock() bool {
|
||||
return self.Mods.HasCapsLock()
|
||||
}
|
||||
|
||||
func KeyEventFromCSI(csi string) *KeyEvent {
|
||||
if len(csi) == 0 {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user