Closed Bug 1299875 Opened 5 years ago Closed 5 years ago

Invalid altKey attribute of the keydown event when typing a character with AltGr


(Core :: Widget: Win32, defect)

48 Branch
Windows 7
Not set





(Reporter: tszynalski, Unassigned)



(Keywords: regression)

1. Go to
2. Enable "modifiers".
3. Switch to a keyboard layout that uses key combinations with AltGr, e.g. Polish Programmers, US International, German etc.
4. Type AltGr+E (or another bound AltGr combo).
5. Notice that, for the keydown event for the E keystroke, the altKey and ctrlKey attributes are both false.

If you type an AltGr combo that's not used in the current layout, the altKey and ctrlKey attributes are both set to true, as they should be. (ctrlKey should be true because on Windows, AltGr is implemented as RAlt+LControl).

This is a new bug that breaks sites that use keyboard shortcuts with the Alt modifier key.
Confirmed the issue on Windows 7 32bit, Polish Programmers keyboard layout.

here's regression range:

looks like it's from bug 1154183.

Then, it's fixed in the following range:

maybe from bug 1293505?.

Tomasz, can you check if it's also fixed on nightly for you?
Blocks: 1154183
QA Whiteboard: [bugday-20160905]
Component: Untriaged → Widget: Win32
Ever confirmed: true
Flags: needinfo?(tszynalski)
Keywords: regression
Product: Firefox → Core
See Also: → 1293505
Um, this should be a long standing bug.

TextEditor (nsPlaintextEditor) doesn't handle keypress events whose Ctrl or Alt state is true as text input.  Therefore, we used to remove Alt/Ctrl key state in widget when the key press causes some text input.,582,589-590

Instead, WidgetKeyboardEvent should have a flag indicating if it's a printable event.

On the other hand, web pages can retrieve if "AltGraph" is active with KeyboardEvent.getModifierState().

Although, the hack was applied only for keypress but applied for keydown too after bug 1154183?
Yep, it is fixed in the current Nightly. Thank you for looking into it.
Flags: needinfo?(tszynalski)
per last comment
Closed: 5 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.