godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.34k stars 21.06k forks source link

OS.has_touchscreen_ui_hint reports false on Steam Deck #68518

Open mnn opened 1 year ago

mnn commented 1 year ago

Godot version

3.5.1.stable.official

System information

Steam Deck

Issue description

Docs:

Returns true if the device has a touchscreen or emulates one.

OS.has_touchscreen_ui_hint reports false on Steam Deck, despite the device having a touchscreen.

Steps to reproduce

Call OS.has_touchscreen_ui_hint on Steam Deck.

Minimal reproduction project

func _ready() -> void:
    print("Touchscreen: %s" % [OS.has_touchscreen_ui_hint()])
Akylzhan commented 1 year ago

Are you using Linux on Steam Deck? From what I see Godot just checks if touch emulation from mouse is turned on:

https://github.com/godotengine/godot/blob/28afd32d29df78283d0433680812c70edfb14c65/core/os/os.cpp#L443-L446

On Windows it is properly implemented though. I might be wrong since I am not an expert in Godot codebase

mnn commented 1 year ago

Yes, Linux - SteamOS I think (the official preinstalled thing from Valve based on Arch). I was trying it in "game mode" (which players are most likely be using), not the desktop mode.

I think it does some emulation too - but it's probably not mouse emulating touch input (maybe pads are emulating mouse?).

Akylzhan commented 1 year ago

@mnn I meant, Godot has an option to emulate touch from mouse in Project Settings, try turning it on

Calinou commented 1 year ago

Related to https://github.com/godotengine/godot/issues/44578.

Actual touchscreen (and touch event) recognition isn't implemented on Linux yet. It's not easy to get working, unlike most other platforms.

adamscott commented 1 year ago

For more information, see Arch's wiki page on the subject. Does not seem simple.