godot icon indicating copy to clipboard operation
godot copied to clipboard

Web exported control/shift/alt keys are reported as KEY_C/KEY_S/KEY_A

Open pipejakob opened this issue 2 years ago • 0 comments

Godot version

v4.0.stable.official [92bee43ad]

System information

Linux (Debian 11.6), Firefox 102.8.0esr (64-bit) and Chromium 110.0.5481.177

Issue description

In 4.0 web exports, the call Input.is_physical_key_pressed(key) returns true for key value KEY_A when Alt is pressed, for KEY_S when Shift is pressed, and for KEY_C when Control is pressed. I assume it is somehow due to the first character of the full key name matching.

This only affects Input.is_physical_key_pressed on web exports in 4.0. I've confirmed that Input.is_key_pressed works as expected in web exports, that both functions work as expected when launching a game from the editor, and that web exports in 3.5.1 work as expected. So it is only the combination of 4.0 + web export + Input.is_physical_key_pressed that is misbehaving.

I tested using both Firefox and Chromium under Linux.

Steps to reproduce

  1. Download and import the attached project.
  2. Export it for the web.
  3. Open the exported game in your browser.
  4. Press Alt, Shift, and Control, and see that the game reports that KEY_A, KEY_S, and KEY_C are being pressed.

Minimal reproduction project

godot_web_keys.zip

pipejakob avatar Mar 05 '23 05:03 pipejakob