Skip to content

Commit

Permalink
Merge pull request #21 from ther0n/disable-mouse-accel-fix
Browse files Browse the repository at this point in the history
Fixes issue #20
  • Loading branch information
ther0n authored Feb 4, 2021
2 parents 91cde77 + 0a6124e commit 0285073
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions UnnaturalScrollWheels.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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";
Expand Down
5 changes: 5 additions & 0 deletions UnnaturalScrollWheels/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion UnnaturalScrollWheels/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>186</string>
<string>190</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
Expand Down
5 changes: 0 additions & 5 deletions UnnaturalScrollWheels/PreferencesViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down

0 comments on commit 0285073

Please sign in to comment.