KeyHandlerInput // + Conditioning for Tab key.
This commit is contained in:
parent
384be9aa0e
commit
a72f1a45f2
|
@ -22,6 +22,7 @@ import Cocoa
|
|||
// KeyCodes: https://eastmanreference.com/complete-list-of-applescript-key-codes
|
||||
enum KeyCode: UInt16 {
|
||||
case none = 0
|
||||
case tab = 48
|
||||
case enter = 76
|
||||
case up = 126
|
||||
case down = 125
|
||||
|
@ -143,6 +144,10 @@ class KeyHandlerInput: NSObject {
|
|||
return code.rawValue != KeyCode.none.rawValue
|
||||
}
|
||||
|
||||
@objc var isTab: Bool {
|
||||
KeyCode(rawValue: keyCode) == KeyCode.tab
|
||||
}
|
||||
|
||||
@objc var isEnter: Bool {
|
||||
(CharCode(rawValue: charCode) == CharCode.enter) || (KeyCode(rawValue: keyCode) == KeyCode.enter)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue