1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 15:07:44 +08:00

Fix MouseHandler not being ignored when raw input is enabled

This commit is contained in:
Leon Gebler 2020-12-01 22:26:17 +01:00
parent 76035718bb
commit bbde1f6b9c

View File

@ -6,6 +6,7 @@ using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Configuration; using osu.Framework.Configuration;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Input.Handlers.Mouse;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Input; using osu.Game.Input;
@ -18,7 +19,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
private readonly BindableBool rawInputToggle = new BindableBool(); private readonly BindableBool rawInputToggle = new BindableBool();
private Bindable<double> sensitivityBindable = new BindableDouble(); private Bindable<double> sensitivityBindable = new BindableDouble();
private Bindable<string> ignoredInputHandler; private Bindable<string> ignoredInputHandlers;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuConfigManager osuConfig, FrameworkConfigManager config) private void load(OsuConfigManager osuConfig, FrameworkConfigManager config)
@ -75,20 +76,21 @@ namespace osu.Game.Overlays.Settings.Sections.Input
{ {
// this is temporary until we support per-handler settings. // this is temporary until we support per-handler settings.
const string raw_mouse_handler = @"OsuTKRawMouseHandler"; const string raw_mouse_handler = @"OsuTKRawMouseHandler";
const string standard_mouse_handler = @"OsuTKMouseHandler"; const string osutk_standard_mouse_handler = @"OsuTKMouseHandler";
string standardMouseHandlers = $"{osutk_standard_mouse_handler} {nameof(MouseHandler)}";
ignoredInputHandler.Value = enabled.NewValue ? standard_mouse_handler : raw_mouse_handler; ignoredInputHandlers.Value = enabled.NewValue ? standardMouseHandlers : raw_mouse_handler;
}; };
ignoredInputHandler = config.GetBindable<string>(FrameworkSetting.IgnoredInputHandlers); ignoredInputHandlers = config.GetBindable<string>(FrameworkSetting.IgnoredInputHandlers);
ignoredInputHandler.ValueChanged += handler => ignoredInputHandlers.ValueChanged += handler =>
{ {
bool raw = !handler.NewValue.Contains("Raw"); bool raw = !handler.NewValue.Contains("Raw");
rawInputToggle.Value = raw; rawInputToggle.Value = raw;
sensitivityBindable.Disabled = !raw; sensitivityBindable.Disabled = !raw;
}; };
ignoredInputHandler.TriggerChange(); ignoredInputHandlers.TriggerChange();
} }
} }