Skip to content

Commit

Permalink
Disable "relative mode" by default on iOS
Browse files Browse the repository at this point in the history
Broken etc.
  • Loading branch information
frenzibyte committed Dec 24, 2024
1 parent 2bbe2d1 commit 52ed8e7
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 @@ -83,6 +86,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 IEnumerable<KeyBinding> PlatformKeyBindings => MacOSGameHost.KeyBindings;
}
}

0 comments on commit 52ed8e7

Please sign in to comment.