@@ -25,6 +25,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
2525 AXIsProcessTrustedWithOptions ( [ kAXTrustedCheckOptionPrompt. takeRetainedValue ( ) as NSString : true ] as NSDictionary )
2626
2727 TouchBarController . shared. setupControlStripPresence ( )
28+ HapticFeedbackUpdate ( )
2829
2930 if let button = statusItem. button {
3031 button. image = #imageLiteral( resourceName: " StatusImage " )
@@ -40,6 +41,10 @@ class AppDelegate: NSObject, NSApplicationDelegate {
4041
4142 func applicationWillTerminate( _: Notification ) { }
4243
44+ func HapticFeedbackUpdate( ) {
45+ HapticFeedback . shared = TouchBarController . shared. hapticFeedbackState ? HapticFeedback ( ) : nil
46+ }
47+
4348 @objc func updateIsBlockedApp( ) {
4449 var blacklistAppIdentifiers : [ String ] = [ ]
4550 if let blackListed = UserDefaults . standard. stringArray ( forKey: " com.toxblh.mtmr.blackListedApps " ) {
@@ -90,6 +95,12 @@ class AppDelegate: NSObject, NSApplicationDelegate {
9095 }
9196 }
9297
98+ @objc func toggleHapticFeedback( _: Any ? ) {
99+ TouchBarController . shared. hapticFeedbackState = !TouchBarController. shared. hapticFeedbackState
100+ HapticFeedbackUpdate ( )
101+ createMenu ( )
102+ }
103+
93104 @objc func openPreset( _: Any ? ) {
94105 let dialog = NSOpenPanel ( )
95106
@@ -124,6 +135,9 @@ class AppDelegate: NSObject, NSApplicationDelegate {
124135 let hideControlStrip = NSMenuItem ( title: " Hide Control Strip " , action: #selector( toggleControlStrip ( _: ) ) , keyEquivalent: " T " )
125136 hideControlStrip. state = TouchBarController . shared. showControlStripState ? . off : . on
126137
138+ let hapticFeedback = NSMenuItem ( title: " Haptic Feedback " , action: #selector( toggleHapticFeedback ( _: ) ) , keyEquivalent: " H " )
139+ hapticFeedback. state = TouchBarController . shared. hapticFeedbackState ? . on : . off
140+
127141 let settingSeparator = NSMenuItem ( title: " Settings " , action: nil , keyEquivalent: " " )
128142 settingSeparator. isEnabled = false
129143
@@ -133,6 +147,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
133147
134148 menu. addItem ( NSMenuItem . separator ( ) )
135149 menu. addItem ( settingSeparator)
150+ menu. addItem ( hapticFeedback)
136151 menu. addItem ( hideControlStrip)
137152 menu. addItem ( toggleBlackList)
138153 menu. addItem ( startAtLogin)
0 commit comments