ppy / osu

rhythm is just a *click* away!
https://osu.ppy.sh
MIT License
15.01k stars 2.21k forks source link

Lifting finger registered as click on Steam Deck with Touchscreen Native Support #20199

Open Stevoisiak opened 2 years ago

Stevoisiak commented 2 years ago

Type

Game behaviour

Bug description

When Touchscreen Native Support is enabled on a Steam Deck, touches are registered as two clicks: Once when a finger touches the screen, and again when the finger leaves the screen.

This is similar to https://osu.ppy.sh/community/forums/topics/40805?n=1 but for SteamOS instead of Windows. The thread mentions an input option to fix this, but the thread is 12 years old and I cannot find this option in lazer.

Steps to reproduce:

  1. Switch to SteamOS desktop mode and install osu! in the Discover package manager.
  2. Open Steam client while still in desktop mode and add osu! as a non-steam game. (Add a game > Add a Non-Steam Game)
  3. Return to SteamOS Gaming Mode and launch osu!
  4. Press the Steam button and select osu! > Controller settings > Controller settings > Edit Layout > Action Sets
  5. Click the Gear Icon and select 'Add Always-On command'
  6. Select Add command > System > Touchscreen Native Support.
  7. Press the Steam button to close the overlay and return to osu!
  8. Tap and release the "Settings" button on the touch screen.

Expected result: The settings menu opens and stays open.

Actual result: The settings menu opens when you tap the screen and closes when you release.

Screenshots or videos

https://user-images.githubusercontent.com/1330770/189225612-42a94a7d-9f1b-4eda-8a45-9f3706a07680.mp4

Version

2022.902.1-lazer

Logs

performance.log runtime.log database.log network.log

jai-x commented 2 years ago

I'm unsure on how relevant that threads advice since it it's talking about osu!stable and also the code handling path is for Windows Ink which is a windows only feature and the Steam Deck is not running Windows in your video.

If possible, are you able to toggle the "Touch" setting in the options overlay to see if that makes a difference? I would guess that osu!lazer is handling both the touch screen events and the synthetic click events generated from the device so disabling this might help? image

Stevoisiak commented 2 years ago

If possible, are you able to toggle the "Touch" setting in the options overlay to see if that makes a difference?

Disabling touch completely disables touch screen input.

jvyden commented 1 year ago

Fixed this issue by turning off "High precision mouse" in settings.

Nevermind, this seems to just cause both touches to happen on the first touch.

mtolly commented 1 year ago

I looked into this issue a bit. After adding some log lines to a few framework locations, this is what I get in the log for a single press + release of the top-left settings button:

(press finger)

[runtime] 2023-01-13 01:10:05 [verbose]: handleTouchFingerEvent SDL_FINGERDOWN 298
[runtime] 2023-01-13 01:10:05 [verbose]: handleTouchDown
[runtime] 2023-01-13 01:10:05 [verbose]: handleTouchFingerEvent SDL_FINGERUP 298
[runtime] 2023-01-13 01:10:05 [verbose]: handleTouchUp
[runtime] 2023-01-13 01:10:05 [verbose]: handleTouchFingerEvent SDL_FINGERDOWN 298
[runtime] 2023-01-13 01:10:05 [verbose]: handleTouchDown
[runtime] 2023-01-13 01:10:05 [verbose]: HandleMouseTouchStateChange: Touch1 True
[runtime] 2023-01-13 01:10:05 [verbose]: mouseMappedTouchesDown.Count = 1
[runtime] 2023-01-13 01:10:05 [verbose]: MouseDownEvent(Left) handled by Toolbar.
[runtime] 2023-01-13 01:10:05 [verbose]: HandleMouseTouchStateChange: Touch1 False
[runtime] 2023-01-13 01:10:05 [verbose]: mouseMappedTouchesDown.Count = 0
[runtime] 2023-01-13 01:10:05 [verbose]: ClickEvent(Left) handled by ToolbarSettingsButton.
[runtime] 2023-01-13 01:10:05 [debug]: MouseClick handled by ToolbarSettingsButton.
[runtime] 2023-01-13 01:10:05 [verbose]: HandleMouseTouchStateChange: Touch1 True
[runtime] 2023-01-13 01:10:05 [verbose]: mouseMappedTouchesDown.Count = 1
[runtime] 2023-01-13 01:10:05 [verbose]: MouseDownEvent(Left) handled by Toolbar.
[runtime] 2023-01-13 01:10:05 [debug]: Focus changed from nothing to SeekLimitedSearchTextBox.

(release finger)

[runtime] 2023-01-13 01:10:06 [verbose]: handleTouchFingerEvent SDL_FINGERUP 298
[runtime] 2023-01-13 01:10:06 [verbose]: handleTouchUp
[runtime] 2023-01-13 01:10:06 [verbose]: HandleMouseTouchStateChange: Touch1 False
[runtime] 2023-01-13 01:10:06 [verbose]: mouseMappedTouchesDown.Count = 0
[runtime] 2023-01-13 01:10:06 [debug]: Focus changed from SeekLimitedSearchTextBox to nothing.
[runtime] 2023-01-13 01:10:06 [verbose]: ClickEvent(Left) handled by ToolbarSettingsButton.
[runtime] 2023-01-13 01:10:06 [debug]: MouseClick handled by ToolbarSettingsButton.

The handleTouchFingerEvent log, I placed right at the start of this SDL2DesktopWindow method. So the problem is that when I press a finger down, SDL is somehow getting three touch events, press-release-press, instead of just a press. The first press-release pair is creating an extra mouse click upon press down which should not happen. But it seems like the issue is either on Valve's end or SDL's, and not something osu or osu-framework is doing wrong.

McKay42 commented 6 months ago

Can confirm this is definitely a Valve/SDL bug, happens here too. Also, the fingerId is incrementing indefinitely with every new touch, which makes no sense whatsoever, why would this ever be implemented like that? Absolute madness.

steamuserimages-a akamaihd