Sometimes modifier keys do not work properly in Linux
Categories
(Core :: DOM: UI Events & Focus Handling, defect, P3)
Tracking
()
People
(Reporter: germionabest26, Unassigned)
Details
- To reproduce:
- Open a new tab in Firefox on Linux.
- Execute the following code snippet in the developer console:
document.onkeydown = e => {
if (e.key === 'Alt') console.log('Alt: ' + e.altKey);
else if (e.key === 'Control') console.log('Control: ' + e.ctrlKey);
else if (e.key === 'Shift') console.log('Shift: ' + e.shiftKey);
};
- Focus on the page and start pressing Alt or Ctrl or Shift.
-
Actual Results:
Sometimes it is happens often, sometimes it is happens seldom, but it happens, so I recommend to press each modifier for at least 100 or 1000 times. For example, you can see my result on the following screenshot -
Expected Results:
Always True in the console
It works in Firefox 67.0.4 on Arch Linux with 5.1.15-arch1-1-ARCH kernel. The issue can be reproduced in Firefox Nightly 69.0a1.20190521.
Also works in the Firefox Nightly 70.0a1.20190712 on Kali-Rolling 2019.2 based on Debian.
Not reproducible in Chromium 75.0.3770.100.
Comment 1•4 years ago
|
||
Hi ,
I've chosen a component for this bug in hope that someone with more expertise may look at it. We'll await their answer. If you consider that there's another component that's more proper for this case you may change it.
Regards, Flor.
Comment 2•4 years ago
|
||
I was unable to represent that behavior with Firefox 72 nightly on KUbuntu 18.04, so I' ran a quick mozregression:
70.0a1 from 2019-07-08 didn't contain it either.
That means either your DE/individual setup is causing issues (have you tried a clean profile?) or we didn't have the same test procedure.
Initially I tested on about:blank but I retried that on the new tab page just no and was unable to experience an issue.
Do both OS run Gnome by any chance?
Updated•4 years ago
|
Comment 3•4 years ago
|
||
On Linux, modifier state is updated every after pressing and releasing key event, but modifier state of DOM keyboard event for modifier keys needs to include the following modifier state. Therefore, we look for a next event in X11. So, I guess that on the reporter's environment, the next event may be sometimes different event or there is sometimes no events. I bet to the former. I'll post a test build which can log the next events of modifier key press/releases.
Updated•2 years ago
|
Description
•