mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 09:07:25 +08:00
Merge pull request #21638 from Mogiiii/touchscreen-control-disable-mouse
Disable touchscreen controls responding to mouse in scrolling gamemodes
This commit is contained in:
commit
98483d2a1b
@ -11,7 +11,6 @@ using osu.Framework.Input.Bindings;
|
|||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Input;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.UI
|
namespace osu.Game.Rulesets.Catch.UI
|
||||||
{
|
{
|
||||||
@ -106,41 +105,17 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnMouseDown(MouseDownEvent e)
|
|
||||||
{
|
|
||||||
return updateAction(e.Button, getTouchCatchActionFromInput(e.ScreenSpaceMousePosition));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override bool OnTouchDown(TouchDownEvent e)
|
protected override bool OnTouchDown(TouchDownEvent e)
|
||||||
{
|
{
|
||||||
return updateAction(e.Touch.Source, getTouchCatchActionFromInput(e.ScreenSpaceTouch.Position));
|
return updateAction(e.Touch.Source, getTouchCatchActionFromInput(e.ScreenSpaceTouch.Position));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnMouseMove(MouseMoveEvent e)
|
|
||||||
{
|
|
||||||
Show();
|
|
||||||
|
|
||||||
TouchCatchAction? action = getTouchCatchActionFromInput(e.ScreenSpaceMousePosition);
|
|
||||||
|
|
||||||
// multiple mouse buttons may be pressed and handling the same action.
|
|
||||||
foreach (MouseButton button in e.PressedButtons)
|
|
||||||
updateAction(button, action);
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnTouchMove(TouchMoveEvent e)
|
protected override void OnTouchMove(TouchMoveEvent e)
|
||||||
{
|
{
|
||||||
updateAction(e.Touch.Source, getTouchCatchActionFromInput(e.ScreenSpaceTouch.Position));
|
updateAction(e.Touch.Source, getTouchCatchActionFromInput(e.ScreenSpaceTouch.Position));
|
||||||
base.OnTouchMove(e);
|
base.OnTouchMove(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnMouseUp(MouseUpEvent e)
|
|
||||||
{
|
|
||||||
updateAction(e.Button, null);
|
|
||||||
base.OnMouseUp(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnTouchUp(TouchUpEvent e)
|
protected override void OnTouchUp(TouchUpEvent e)
|
||||||
{
|
{
|
||||||
updateAction(e.Touch.Source, null);
|
updateAction(e.Touch.Source, null);
|
||||||
|
@ -209,18 +209,6 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
keyBindingContainer = maniaInputManager?.KeyBindingContainer;
|
keyBindingContainer = maniaInputManager?.KeyBindingContainer;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnMouseDown(MouseDownEvent e)
|
|
||||||
{
|
|
||||||
keyBindingContainer?.TriggerPressed(column.Action.Value);
|
|
||||||
return base.OnMouseDown(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnMouseUp(MouseUpEvent e)
|
|
||||||
{
|
|
||||||
keyBindingContainer?.TriggerReleased(column.Action.Value);
|
|
||||||
base.OnMouseUp(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override bool OnTouchDown(TouchDownEvent e)
|
protected override bool OnTouchDown(TouchDownEvent e)
|
||||||
{
|
{
|
||||||
keyBindingContainer?.TriggerPressed(column.Action.Value);
|
keyBindingContainer?.TriggerPressed(column.Action.Value);
|
||||||
|
@ -107,24 +107,6 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnMouseDown(MouseDownEvent e)
|
|
||||||
{
|
|
||||||
if (!validMouse(e))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
handleDown(e.Button, e.ScreenSpaceMousePosition);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnMouseUp(MouseUpEvent e)
|
|
||||||
{
|
|
||||||
if (!validMouse(e))
|
|
||||||
return;
|
|
||||||
|
|
||||||
handleUp(e.Button);
|
|
||||||
base.OnMouseUp(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override bool OnTouchDown(TouchDownEvent e)
|
protected override bool OnTouchDown(TouchDownEvent e)
|
||||||
{
|
{
|
||||||
handleDown(e.Touch.Source, e.ScreenSpaceTouchDownPosition);
|
handleDown(e.Touch.Source, e.ScreenSpaceTouchDownPosition);
|
||||||
|
Loading…
Reference in New Issue
Block a user