mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 05:52:54 +08:00
Hide the game-wide cursor on touch input
This commit is contained in:
parent
a0bc376446
commit
daff060c9a
@ -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 = GetContainingInputManager().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