KeyHandlerInput // + Conditioning for Esc key.
This commit is contained in:
parent
59857849f8
commit
cc8aef91c6
|
@ -22,6 +22,7 @@ import Cocoa
|
||||||
// KeyCodes: https://eastmanreference.com/complete-list-of-applescript-key-codes
|
// KeyCodes: https://eastmanreference.com/complete-list-of-applescript-key-codes
|
||||||
enum KeyCode: UInt16 {
|
enum KeyCode: UInt16 {
|
||||||
case none = 0
|
case none = 0
|
||||||
|
case esc = 53
|
||||||
case tab = 48
|
case tab = 48
|
||||||
case enter = 76
|
case enter = 76
|
||||||
case up = 126
|
case up = 126
|
||||||
|
@ -185,7 +186,7 @@ class KeyHandlerInput: NSObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc var isESC: Bool {
|
@objc var isESC: Bool {
|
||||||
CharCode(rawValue: charCode) == CharCode.esc
|
(CharCode(rawValue: charCode) == CharCode.esc) || (KeyCode(rawValue: keyCode) == KeyCode.esc)
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc var isHome: Bool {
|
@objc var isHome: Bool {
|
||||||
|
|
Loading…
Reference in New Issue