protonscr

Sending certain characters to HTML text input elements via SteamHTMLSurface KeyDown() or KeyChar() does nothing.

steamclosed Web Component
ValveSoftware/steam-for-linux#9548 · opened 2023-05-31 by lmptg · updated 2023-06-05 · 1 comments · github
Llmptg 2023-05-31 github

Your system information

  • Steam client version (build number or date): built May 30 2023 20:40:12
  • Distribution (e.g. Ubuntu): Endeavor OS (Arch based distro)
  • Opted into Steam client beta?: No
  • Have you checked for system updates?: Yes

Please describe your issue in as much detail as possible:

When calling:

SteamHTMLSurface()->KeyDown(browserHandle, 8, ISteamHTMLSurface::k_eHTMLKeyModifier_None);

or

SteamHTMLSurface()->KeyChar(browserHandle, 8, ISteamHTMLSurface::k_eHTMLKeyModifier_None);

... on a focused HTML input text element I'd expect that the entered text has the last character removed - just like when doing normal BACKSPACE keyboard input in any HTML input element in any browser. As an example this puts an a in my focused HTML input element:
SteamHTMLSurface()->KeyChar(browserHandle, 97, ISteamHTMLSurface::k_eHTMLKeyModifier_None);

Steam built-in CEF/HTML backend seem to ignore when sending backspace character codes via KeyChar/KeyDown (the docs are not clear on when to use which - but no combination of order and calls seem to make a difference).

It's worth noting that I can't get arrow keys to work either (I-beam) cursor doesn't move when sending codes 37, 38, 39, 40

Steps for reproducing this issue:

  1. Setup the HHTMLBrowser + Input handling via C++ and SDL2 - things render fine and normal ASCII alphabet + space + numbers 0-9 characters and works in HTML text input elements via KeyChar/KeyDown

  2. Send nNativeKeyCode = 8 as input to either of KeyChar/KeyDown

  3. No characters are deleted from the HTML text input element

Any help will be greatly appreciated

Llmptg 2023-06-05 github

Turns out it has to be the key code values that Gnome GTK/GDK defines in gdkkeysyms.h since the runtime is based on Ubuntu. I'm on an Arch based distro.

Nothing extracted yet.