@@ -25,6 +25,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
25
25
AXIsProcessTrustedWithOptions ( [ kAXTrustedCheckOptionPrompt. takeRetainedValue ( ) as NSString : true ] as NSDictionary )
26
26
27
27
TouchBarController . shared. setupControlStripPresence ( )
28
+ HapticFeedbackUpdate ( )
28
29
29
30
if let button = statusItem. button {
30
31
button. image = #imageLiteral( resourceName: " StatusImage " )
@@ -40,6 +41,10 @@ class AppDelegate: NSObject, NSApplicationDelegate {
40
41
41
42
func applicationWillTerminate( _: Notification ) { }
42
43
44
+ func HapticFeedbackUpdate( ) {
45
+ HapticFeedback . shared = TouchBarController . shared. hapticFeedbackState ? HapticFeedback ( ) : nil
46
+ }
47
+
43
48
@objc func updateIsBlockedApp( ) {
44
49
var blacklistAppIdentifiers : [ String ] = [ ]
45
50
if let blackListed = UserDefaults . standard. stringArray ( forKey: " com.toxblh.mtmr.blackListedApps " ) {
@@ -90,6 +95,12 @@ class AppDelegate: NSObject, NSApplicationDelegate {
90
95
}
91
96
}
92
97
98
+ @objc func toggleHapticFeedback( _: Any ? ) {
99
+ TouchBarController . shared. hapticFeedbackState = !TouchBarController. shared. hapticFeedbackState
100
+ HapticFeedbackUpdate ( )
101
+ createMenu ( )
102
+ }
103
+
93
104
@objc func openPreset( _: Any ? ) {
94
105
let dialog = NSOpenPanel ( )
95
106
@@ -124,6 +135,9 @@ class AppDelegate: NSObject, NSApplicationDelegate {
124
135
let hideControlStrip = NSMenuItem ( title: " Hide Control Strip " , action: #selector( toggleControlStrip ( _: ) ) , keyEquivalent: " T " )
125
136
hideControlStrip. state = TouchBarController . shared. showControlStripState ? . off : . on
126
137
138
+ let hapticFeedback = NSMenuItem ( title: " Haptic Feedback " , action: #selector( toggleHapticFeedback ( _: ) ) , keyEquivalent: " H " )
139
+ hapticFeedback. state = TouchBarController . shared. hapticFeedbackState ? . on : . off
140
+
127
141
let settingSeparator = NSMenuItem ( title: " Settings " , action: nil , keyEquivalent: " " )
128
142
settingSeparator. isEnabled = false
129
143
@@ -133,6 +147,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
133
147
134
148
menu. addItem ( NSMenuItem . separator ( ) )
135
149
menu. addItem ( settingSeparator)
150
+ menu. addItem ( hapticFeedback)
136
151
menu. addItem ( hideControlStrip)
137
152
menu. addItem ( toggleBlackList)
138
153
menu. addItem ( startAtLogin)
0 commit comments