mirror of
https://github.com/Toxblh/MTMR.git
synced 2026-01-09 16:48:38 +00:00
Revert "More Productive Gestures (#289)"
This reverts commit f61550e510.
This commit is contained in:
parent
52758f947d
commit
6d266394a4
@ -76,7 +76,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
} else {
|
||||
TouchBarController.shared.blacklistAppIdentifiers.append(appIdentifier)
|
||||
}
|
||||
|
||||
|
||||
AppSettings.blacklistedAppIds = TouchBarController.shared.blacklistAppIdentifiers
|
||||
TouchBarController.shared.updateActiveApp()
|
||||
updateIsBlockedApp()
|
||||
@ -132,7 +132,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
let hapticFeedback = NSMenuItem(title: "Haptic Feedback", action: #selector(toggleHapticFeedback(_:)), keyEquivalent: "H")
|
||||
hapticFeedback.state = AppSettings.hapticFeedbackState ? .on : .off
|
||||
|
||||
let multitouchGestures = NSMenuItem(title: "Default Swipe Gestures", action: #selector(toggleMultitouch(_:)), keyEquivalent: "")
|
||||
let multitouchGestures = NSMenuItem(title: "Volume/Brightness gestures", action: #selector(toggleMultitouch(_:)), keyEquivalent: "")
|
||||
multitouchGestures.state = AppSettings.multitouchGestures ? .on : .off
|
||||
|
||||
let settingSeparator = NSMenuItem(title: "Settings", action: nil, keyEquivalent: "")
|
||||
|
||||
@ -10,7 +10,6 @@ import Foundation
|
||||
|
||||
|
||||
class BasicView: NSCustomTouchBarItem, NSGestureRecognizerDelegate {
|
||||
var onefinger: NSPanGestureRecognizer!
|
||||
var twofingers: NSPanGestureRecognizer!
|
||||
var threefingers: NSPanGestureRecognizer!
|
||||
var fourfingers: NSPanGestureRecognizer!
|
||||
@ -31,11 +30,6 @@ class BasicView: NSCustomTouchBarItem, NSGestureRecognizerDelegate {
|
||||
stackView.orientation = .horizontal
|
||||
view = stackView
|
||||
|
||||
onefinger = NSPanGestureRecognizer(target: self, action: #selector(onefingerHandler(_:)))
|
||||
onefinger.numberOfTouchesRequired = 1
|
||||
onefinger.allowedTouchTypes = .direct
|
||||
view.addGestureRecognizer(onefinger)
|
||||
|
||||
twofingers = NSPanGestureRecognizer(target: self, action: #selector(twofingersHandler(_:)))
|
||||
twofingers.numberOfTouchesRequired = 2
|
||||
twofingers.allowedTouchTypes = .direct
|
||||
@ -63,31 +57,9 @@ class BasicView: NSCustomTouchBarItem, NSGestureRecognizerDelegate {
|
||||
legacyPrevPositions[fingers] = position
|
||||
case .changed:
|
||||
if self.legacyGesturesEnabled {
|
||||
if fingers == 1 {
|
||||
let prevPos = legacyPrevPositions[fingers]!
|
||||
if ((position - prevPos) > 3) || ((prevPos - position) > 3) {
|
||||
if position > prevPos {
|
||||
GenericKeyPress(keyCode: CGKeyCode(124)).send()
|
||||
} else if position < prevPos {
|
||||
GenericKeyPress(keyCode: CGKeyCode(123)).send()
|
||||
}
|
||||
legacyPrevPositions[fingers] = position
|
||||
}
|
||||
}
|
||||
if fingers == 2 {
|
||||
let prevPos = legacyPrevPositions[fingers]!
|
||||
if ((position - prevPos) > 50) || ((prevPos - position) > 50) {
|
||||
if position > prevPos {
|
||||
GenericKeyPress(keyCode: CGKeyCode(124)).send()
|
||||
} else if position < prevPos {
|
||||
GenericKeyPress(keyCode: CGKeyCode(123)).send()
|
||||
}
|
||||
legacyPrevPositions[fingers] = position
|
||||
}
|
||||
}
|
||||
if fingers == 3 {
|
||||
let prevPos = legacyPrevPositions[fingers]!
|
||||
if ((position - prevPos) > 15) || ((prevPos - position) > 15) {
|
||||
if ((position - prevPos) > 10) || ((prevPos - position) > 10) {
|
||||
if position > prevPos {
|
||||
HIDPostAuxKey(NX_KEYTYPE_SOUND_UP)
|
||||
} else if position < prevPos {
|
||||
@ -96,7 +68,7 @@ class BasicView: NSCustomTouchBarItem, NSGestureRecognizerDelegate {
|
||||
legacyPrevPositions[fingers] = position
|
||||
}
|
||||
}
|
||||
if fingers == 4 {
|
||||
if fingers == 3 {
|
||||
let prevPos = legacyPrevPositions[fingers]!
|
||||
if ((position - prevPos) > 15) || ((prevPos - position) > 15) {
|
||||
if position > prevPos {
|
||||
@ -118,11 +90,6 @@ class BasicView: NSCustomTouchBarItem, NSGestureRecognizerDelegate {
|
||||
}
|
||||
}
|
||||
|
||||
@objc func onefingerHandler(_ sender: NSGestureRecognizer?) {
|
||||
let position = (sender?.location(in: sender?.view).x)!
|
||||
self.gestureHandler(position: position, fingers: 1, state: sender!.state)
|
||||
}
|
||||
|
||||
@objc func twofingersHandler(_ sender: NSGestureRecognizer?) {
|
||||
let position = (sender?.location(in: sender?.view).x)!
|
||||
self.gestureHandler(position: position, fingers: 2, state: sender!.state)
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.25</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>402</string>
|
||||
<string>385</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.utilities</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
|
||||
13
README.md
13
README.md
@ -104,16 +104,11 @@ The pre-installed configuration contains less or more than you'll probably want,
|
||||
|
||||
## Gestures
|
||||
|
||||
### Default Gestures
|
||||
By default you can enable basic gestures from application menu (status bar -> MTMR icon -> Volume/Brightness gestures):
|
||||
- two finger slide: change you Volume
|
||||
- three finger slide: change you Brightness
|
||||
|
||||
By default you can enable basic gestures from application menu (status bar -> MTMR icon -> Default Swipe Gestures):
|
||||
|
||||
- ```one finger slide```: Move Caret
|
||||
- ```two finger slide```: Move Caret with precision
|
||||
- ```three finger slide```: Increase/Decrease Volume
|
||||
- ```four finger slide```: Increase/Decrease Brightness
|
||||
|
||||
### Custom Gestures
|
||||
### Custom gestures
|
||||
|
||||
You can add custom actions for two/three/four finger swipes. To do it, you need to use `swipe` type:
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user