mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 17:32:54 +08:00
Add settings for toggling raw input and adjusting sensitivity
This commit is contained in:
parent
900e3ce3e2
commit
edead2ad3a
@ -14,9 +14,24 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
|||||||
{
|
{
|
||||||
protected override string Header => "Mouse";
|
protected override string Header => "Mouse";
|
||||||
|
|
||||||
|
private readonly BindableBool rawInputToggle = new BindableBool();
|
||||||
|
private Bindable<string> activeInputHandlers;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuConfigManager osuConfig, FrameworkConfigManager config)
|
private void load(OsuConfigManager osuConfig, FrameworkConfigManager config)
|
||||||
{
|
{
|
||||||
|
activeInputHandlers = config.GetBindable<string>(FrameworkSetting.ActiveInputHandlers);
|
||||||
|
rawInputToggle.Value = activeInputHandlers.Value.Contains("Raw");
|
||||||
|
rawInputToggle.ValueChanged += enabled =>
|
||||||
|
{
|
||||||
|
const string raw_mouse_handler = @"OpenTKRawMouseHandler";
|
||||||
|
const string standard_mouse_handler = @"OpenTKMouseHandler";
|
||||||
|
|
||||||
|
activeInputHandlers.Value = enabled ?
|
||||||
|
activeInputHandlers.Value.Replace(standard_mouse_handler, raw_mouse_handler) :
|
||||||
|
activeInputHandlers.Value.Replace(raw_mouse_handler, standard_mouse_handler);
|
||||||
|
};
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new SettingsEnumDropdown<ConfineMouseMode>
|
new SettingsEnumDropdown<ConfineMouseMode>
|
||||||
@ -34,6 +49,16 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
|||||||
LabelText = "Disable mouse buttons during gameplay",
|
LabelText = "Disable mouse buttons during gameplay",
|
||||||
Bindable = osuConfig.GetBindable<bool>(OsuSetting.MouseDisableButtons)
|
Bindable = osuConfig.GetBindable<bool>(OsuSetting.MouseDisableButtons)
|
||||||
},
|
},
|
||||||
|
new SettingsCheckbox
|
||||||
|
{
|
||||||
|
LabelText = "Raw Input",
|
||||||
|
Bindable = rawInputToggle
|
||||||
|
},
|
||||||
|
new SettingsSlider<double, SensitivitySlider>
|
||||||
|
{
|
||||||
|
LabelText = "Cursor Sensitivity",
|
||||||
|
Bindable = config.GetBindable<double>(FrameworkSetting.CursorSensitivity)
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,4 +67,4 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
|||||||
public override string TooltipText => Current.Value.ToString(@"0.##x");
|
public override string TooltipText => Current.Value.ToString(@"0.##x");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user