mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 20:22:55 +08:00
Merge pull request #10074 from peppy/hide-cursor-on-touch-input
Hide the game-wide cursor on touch input
This commit is contained in:
commit
fd2abc5c1e
@ -5,6 +5,7 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Cursor;
|
||||
using osu.Framework.Input;
|
||||
using osu.Framework.Input.StateChanges;
|
||||
|
||||
namespace osu.Game.Graphics.Cursor
|
||||
{
|
||||
@ -47,7 +48,10 @@ namespace osu.Game.Graphics.Cursor
|
||||
{
|
||||
base.Update();
|
||||
|
||||
if (!CanShowCursor)
|
||||
var lastMouseSource = inputManager.CurrentState.Mouse.LastSource;
|
||||
bool hasValidInput = lastMouseSource != null && !(lastMouseSource is ISourcedFromTouch);
|
||||
|
||||
if (!hasValidInput || !CanShowCursor)
|
||||
{
|
||||
currentTarget?.Cursor?.Hide();
|
||||
currentTarget = null;
|
||||
|
Loading…
Reference in New Issue
Block a user