Open Bug 1816832 Opened 2 years ago Updated 1 year ago

KeyboardEvent.code for escape (and similar keys) is blank when entered with a virtual keyboard

Categories

(GeckoView :: IME, defect, P5)

Firefox 111
All
Android
defect

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: jacksonhgarner, Unassigned)

References

(Blocks 1 open bug)

Details

Steps to reproduce:

Typing the escape key on a virtual keyboard (like Hacker's keyboard or the KeyMapper virtual keyboard) sends an event with a blank "code" field. This can be verified using https://w3c.github.io/uievents/tools/key-event-viewer.html. Plugging a physical keyboard into the android device and typing the escape key triggers an event with "Escape" in the code field.

Actual results:

Typing with the virtual keyboard triggers an event that websites might not be expecting. Websites that identify the keypress by the "code" field can't handle the virtual escape key. For example, I think this prevents parts of the vscode web interface from handling the escape key correctly.

Other keys like Backspace and ArrowDown suffer from this bug as well.

Expected results:

The virtual keyboard should trigger an event with the same "code" field as the physical keyboard per the second paragraph here: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code. Pressing the escape key on a virtual keyboard should trigger an event with "Escape" in the "code" field. Other keys like backspace should have the same behavior.

There is no specification for virual keyboard keycode etc, it depends on Browser Engines and OS, so this is low priority due to no spec.

Component: Browser Engine → IME
Product: Fenix → GeckoView

The severity field is not set for this bug.
:cpeterson, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(cpeterson)
Severity: -- → S3
Flags: needinfo?(cpeterson)
Priority: -- → P5
Severity: S3 → S4
You need to log in before you can comment on or make changes to this bug.