Skip to content

Commit

Permalink
Merge pull request #6469 from frenzibyte/disable-raw-input-by-default
Browse files Browse the repository at this point in the history
Disable "relative mode" by default on iOS
  • Loading branch information
peppy authored Jan 20, 2025
2 parents b19f2c2 + e6182cd commit fe9fc8b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions osu.Framework.iOS/IOSGameHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Foundation;
using osu.Framework.Configuration;
using osu.Framework.Extensions;
using osu.Framework.Extensions.ObjectExtensions;
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;
Expand Down Expand Up @@ -85,6 +88,20 @@ public override IResourceStore<TextureUpload> CreateTextureLoaderStore(IResource
public override VideoDecoder CreateVideoDecoder(Stream stream)
=> new IOSVideoDecoder(Renderer, stream);

protected override IEnumerable<InputHandler> CreateAvailableInputHandlers()
{
var handlers = base.CreateAvailableInputHandlers();

foreach (var h in handlers.OfType<MouseHandler>())
{
// Similar to macOS, "relative mode" is also broken on iOS.
h.UseRelativeMode.Value = false;
h.UseRelativeMode.Default = false;
}

return handlers;
}

public override ISystemFileSelector? CreateSystemFileSelector(string[] allowedExtensions)
{
IOSFileSelector? selector = null;
Expand Down

0 comments on commit fe9fc8b

Please sign in to comment.