godot icon indicating copy to clipboard operation
godot copied to clipboard

[DisplayServer] Implement `has_hardware_keyboard` method for Android and iOS.

Open bruvzg opened this issue 1 year ago • 1 comments

bruvzg avatar Oct 02 '24 17:10 bruvzg

For context, this is needed to resolve https://github.com/godotengine/godot/issues/88235 in a way that doesn't harm usability when a physical keyboard is connected.

Calinou avatar Oct 02 '24 21:10 Calinou

Just tested it on android and it is working properly.

syntaxerror247 avatar Oct 03 '24 07:10 syntaxerror247

Is this something that can be implemented for Web too, when using it on mobile devices?

akien-mga avatar Oct 04 '24 08:10 akien-mga

Is this something that can be implemented for Web too, when using it on mobile devices?

If we use this to return from (LineEdit/TextEdit) show_virtual_keyboard when DisplayServer::get_singleton()->has_hardware_keyboard() is true, it will never show the virtual keyboard on Web (android/ios) since it will always return true on Web.

WhalesState avatar Oct 04 '24 09:10 WhalesState

Yeah I'm fine merging this to have the feature for platforms that support it, but we need to be very careful before we rely on it for engine functionality. There are also Windows or Linux tablets with virtual keyboards where this would return true currently, even if no hardware keyboard is attached.

akien-mga avatar Oct 04 '24 09:10 akien-mga

Thanks!

akien-mga avatar Oct 04 '24 09:10 akien-mga