From c7adf5d77f47daa55d99898b749cbc397277151b Mon Sep 17 00:00:00 2001 From: ytai <653297351@qq.com> Date: Tue, 5 Dec 2023 05:35:40 +0800 Subject: [PATCH] Add toggle for scroll wheel (#132) * comment scroll wheel * Update * Update * Update * Delete package resolved * Update * Revert change in NSObject --- PlayTools/Controls/Frontend/ControlMode.swift | 8 +++++--- PlayTools/PlaySettings.swift | 7 +++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/PlayTools/Controls/Frontend/ControlMode.swift b/PlayTools/Controls/Frontend/ControlMode.swift index 74056bf9..cf6eb9a2 100644 --- a/PlayTools/Controls/Frontend/ControlMode.swift +++ b/PlayTools/Controls/Frontend/ControlMode.swift @@ -65,9 +65,11 @@ public class ControlMode: Equatable { self.keyboardAdapter.handleKey(keycode: keycode, pressed: pressed, isRepeat: isRepeat)}, swapMode: ModeAutomaton.onOption) - AKInterface.shared!.setupScrollWheel({deltaX, deltaY in - self.mouseAdapter.handleScrollWheel(deltaX: deltaX, deltaY: deltaY) - }) + if PlaySettings.shared.enableScrollWheel { + AKInterface.shared!.setupScrollWheel({deltaX, deltaY in + self.mouseAdapter.handleScrollWheel(deltaX: deltaX, deltaY: deltaY) + }) + } AKInterface.shared!.setupMouseMoved({deltaX, deltaY in self.mouseAdapter.handleMove(deltaX: deltaX, deltaY: deltaY) diff --git a/PlayTools/PlaySettings.swift b/PlayTools/PlaySettings.swift index 2f10eb37..8ba67509 100644 --- a/PlayTools/PlaySettings.swift +++ b/PlayTools/PlaySettings.swift @@ -69,10 +69,12 @@ let settings = PlaySettings.shared @objc lazy var windowFixMethod = settingsData.windowFixMethod @objc lazy var customScaler = settingsData.customScaler - + @objc lazy var rootWorkDir = settingsData.rootWorkDir - + @objc lazy var noKMOnInput = settingsData.noKMOnInput + + @objc lazy var enableScrollWheel = settingsData.enableScrollWheel } struct AppSettingsData: Codable { @@ -96,4 +98,5 @@ struct AppSettingsData: Codable { var windowFixMethod = 0 var rootWorkDir = true var noKMOnInput = false + var enableScrollWheel = true }