From 9fce905c741fda984fb6463841ebc92ad9123e33 Mon Sep 17 00:00:00 2001 From: Salman Alshamrani Date: Sat, 21 Dec 2024 14:14:11 -0500 Subject: [PATCH 1/3] Disable "relative mode" by default on platforms which do not handle it well --- osu.Framework/Input/Handlers/Mouse/MouseHandler.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/osu.Framework/Input/Handlers/Mouse/MouseHandler.cs b/osu.Framework/Input/Handlers/Mouse/MouseHandler.cs index aa480152c3..d1f0c03fb8 100644 --- a/osu.Framework/Input/Handlers/Mouse/MouseHandler.cs +++ b/osu.Framework/Input/Handlers/Mouse/MouseHandler.cs @@ -22,10 +22,15 @@ public class MouseHandler : InputHandler, IHasCursorSensitivity, INeedsMousePosi { private static readonly GlobalStatistic statistic_total_events = GlobalStatistics.Get(StatisticGroupFor(), "Total events"); + private static bool relativeModeDefaultState + => RuntimeInfo.OS != RuntimeInfo.Platform.Linux && + RuntimeInfo.OS != RuntimeInfo.Platform.macOS && + RuntimeInfo.OS != RuntimeInfo.Platform.iOS; + /// /// Whether relative mode should be preferred when the window has focus, the cursor is contained and the OS cursor is not visible. /// - public BindableBool UseRelativeMode { get; } = new BindableBool(true) + public BindableBool UseRelativeMode { get; } = new BindableBool(relativeModeDefaultState) { Description = "Allows for sensitivity adjustment and tighter control of input", }; From 2bbe2d1c0417560141b0ff5d87e3e5436d8c2e60 Mon Sep 17 00:00:00 2001 From: Salman Alshamrani Date: Tue, 24 Dec 2024 04:03:04 -0500 Subject: [PATCH 2/3] Revert "Disable "relative mode" by default on platforms which do not handle it well" This reverts commit 9fce905c741fda984fb6463841ebc92ad9123e33. --- osu.Framework/Input/Handlers/Mouse/MouseHandler.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/osu.Framework/Input/Handlers/Mouse/MouseHandler.cs b/osu.Framework/Input/Handlers/Mouse/MouseHandler.cs index d1f0c03fb8..aa480152c3 100644 --- a/osu.Framework/Input/Handlers/Mouse/MouseHandler.cs +++ b/osu.Framework/Input/Handlers/Mouse/MouseHandler.cs @@ -22,15 +22,10 @@ public class MouseHandler : InputHandler, IHasCursorSensitivity, INeedsMousePosi { private static readonly GlobalStatistic statistic_total_events = GlobalStatistics.Get(StatisticGroupFor(), "Total events"); - private static bool relativeModeDefaultState - => RuntimeInfo.OS != RuntimeInfo.Platform.Linux && - RuntimeInfo.OS != RuntimeInfo.Platform.macOS && - RuntimeInfo.OS != RuntimeInfo.Platform.iOS; - /// /// Whether relative mode should be preferred when the window has focus, the cursor is contained and the OS cursor is not visible. /// - public BindableBool UseRelativeMode { get; } = new BindableBool(relativeModeDefaultState) + public BindableBool UseRelativeMode { get; } = new BindableBool(true) { Description = "Allows for sensitivity adjustment and tighter control of input", }; From 52ed8e7b9d0c27929018865205f4ab8237cc6261 Mon Sep 17 00:00:00 2001 From: Salman Alshamrani Date: Tue, 24 Dec 2024 04:04:59 -0500 Subject: [PATCH 3/3] Disable "relative mode" by default on iOS Broken etc. --- osu.Framework.iOS/IOSGameHost.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/osu.Framework.iOS/IOSGameHost.cs b/osu.Framework.iOS/IOSGameHost.cs index f823ba3564..0c9128f5f3 100644 --- a/osu.Framework.iOS/IOSGameHost.cs +++ b/osu.Framework.iOS/IOSGameHost.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Linq; using Foundation; using osu.Framework.Configuration; using osu.Framework.Extensions; @@ -11,6 +12,8 @@ using osu.Framework.Graphics.Textures; using osu.Framework.Graphics.Video; using osu.Framework.Input.Bindings; +using osu.Framework.Input.Handlers; +using osu.Framework.Input.Handlers.Mouse; using osu.Framework.IO.Stores; using osu.Framework.iOS.Graphics.Textures; using osu.Framework.iOS.Graphics.Video; @@ -83,6 +86,20 @@ public override IResourceStore CreateTextureLoaderStore(IResource public override VideoDecoder CreateVideoDecoder(Stream stream) => new IOSVideoDecoder(Renderer, stream); + protected override IEnumerable CreateAvailableInputHandlers() + { + var handlers = base.CreateAvailableInputHandlers(); + + foreach (var h in handlers.OfType()) + { + // Similar to macOS, "relative mode" is also broken on iOS. + h.UseRelativeMode.Value = false; + h.UseRelativeMode.Default = false; + } + + return handlers; + } + public override IEnumerable PlatformKeyBindings => MacOSGameHost.KeyBindings; } }