From 0a6124e1e388e609c1bd60a09bba64a5a1d47315 Mon Sep 17 00:00:00 2001 From: Theron Tjapkes Date: Thu, 4 Feb 2021 12:18:14 -0500 Subject: [PATCH] Fixes issue #20 --- UnnaturalScrollWheels.xcodeproj/project.pbxproj | 4 ++-- UnnaturalScrollWheels/AppDelegate.swift | 5 +++++ UnnaturalScrollWheels/Info.plist | 2 +- UnnaturalScrollWheels/PreferencesViewController.swift | 5 ----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/UnnaturalScrollWheels.xcodeproj/project.pbxproj b/UnnaturalScrollWheels.xcodeproj/project.pbxproj index fbc6ac2..5d8d126 100644 --- a/UnnaturalScrollWheels.xcodeproj/project.pbxproj +++ b/UnnaturalScrollWheels.xcodeproj/project.pbxproj @@ -313,7 +313,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.13; - MARKETING_VERSION = 1.2.1; + MARKETING_VERSION = 1.2.2; PRODUCT_BUNDLE_IDENTIFIER = com.theron.UnnaturalScrollWheels; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "UnnaturalScrollWheels/UnnaturalScrollWheels-Bridging-Header.h"; @@ -339,7 +339,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.13; - MARKETING_VERSION = 1.2.1; + MARKETING_VERSION = 1.2.2; PRODUCT_BUNDLE_IDENTIFIER = com.theron.UnnaturalScrollWheels; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "UnnaturalScrollWheels/UnnaturalScrollWheels-Bridging-Header.h"; diff --git a/UnnaturalScrollWheels/AppDelegate.swift b/UnnaturalScrollWheels/AppDelegate.swift index dcfafcd..01e9abc 100644 --- a/UnnaturalScrollWheels/AppDelegate.swift +++ b/UnnaturalScrollWheels/AppDelegate.swift @@ -130,6 +130,11 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate { Options.shared.origAccel = origAccel UserDefaults.standard.set(origAccel, forKey: "OriginalAccel") } + if Options.shared.disableMouseAccel { + Options.shared.accel = -1 + } else { + Options.shared.accel = Options.shared.origAccel + } // Set the mouse acceleration let accelNum: CFNumber = CFNumberCreate(kCFAllocatorDefault, CFNumberType.sInt32Type, &Options.shared.accel) IOHIDEventSystemClientSetProperty(client, mouseAccelerationType, accelNum) diff --git a/UnnaturalScrollWheels/Info.plist b/UnnaturalScrollWheels/Info.plist index cc9ea48..6672d5d 100644 --- a/UnnaturalScrollWheels/Info.plist +++ b/UnnaturalScrollWheels/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString $(MARKETING_VERSION) CFBundleVersion - 186 + 190 LSApplicationCategoryType public.app-category.utilities LSMinimumSystemVersion diff --git a/UnnaturalScrollWheels/PreferencesViewController.swift b/UnnaturalScrollWheels/PreferencesViewController.swift index e6598aa..ef121dc 100644 --- a/UnnaturalScrollWheels/PreferencesViewController.swift +++ b/UnnaturalScrollWheels/PreferencesViewController.swift @@ -58,11 +58,6 @@ class PreferencesViewController: NSViewController { @IBAction func disableMouseAccelClicked(_ sender: Any){ Options.shared.disableMouseAccel = !Options.shared.disableMouseAccel - if Options.shared.disableMouseAccel { - Options.shared.accel = -1 - } else { - Options.shared.accel = Options.shared.origAccel - } appDelegate?.disableMouseAccel() }