Closed Bug 1023067 Opened 6 years ago Closed 2 years ago

[UI Events] Support "Super" and "Hyper" modifier state on Linux

Categories

(Core :: DOM: Events, defect)

All
Linux
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: masayuki, Assigned: masayuki)

References

(Blocks 2 open bugs, )

Details

Attachments

(5 files, 3 obsolete files)

D3E now defines "Super" and "Hyper" modifiers. That means that with typical mapping on Linux, Pressing Windows logo key shouldn't cause .getModifierState("OS") returning true.

However, we should new modifier state with XUL <key> element, like we did in bug 751749.

There are two options about this:
1. Adding "super" and "hyper" support to XUL <key> element strictly.
2. Mapping "os" of XUL <key> element to "super" and "hyper" too.

I like the approach #2. How about you, Enn?
Flags: needinfo?(enndeakin)
> That means that with typical mapping on Linux, Pressing Windows logo key shouldn't
> cause .getModifierState("OS") returning true.

Why not? Won't there be some compatibility issue here?
Flags: needinfo?(enndeakin)
(In reply to Neil Deakin from comment #1)
> > That means that with typical mapping on Linux, Pressing Windows logo key shouldn't
> > cause .getModifierState("OS") returning true.
> 
> Why not? Won't there be some compatibility issue here?

For web contents, .getModifierState() is an experimental feature. So, we don't need to worry about the backward compatibility.

For addon developers, "os" value of modifiers attribute of <key> event isn't so. We should keep backward compatibility if it's possible. We defined the "os" value in MDN like:

> os: Windows logo key on Windows, Super or Hyper key on Linux. This shouldn't be specified
> directly because it may conflict with system wide shortcut key. Requires Gecko 17.0
OK, seems fine.
I'd recommend making both getModifierState("OS") and getModifierState("Super") return true if the Super key is pressed.  Probably similarly for Hyper.
(In reply to Karl Tomlinson (needinfo?:karlt) from comment #4)
> I'd recommend making both getModifierState("OS") and
> getModifierState("Super") return true if the Super key is pressed.  Probably
> similarly for Hyper.

Although, I don't think so because "OS" state should be activated by "OS" key. However, I should take your concern to WG before fixing this bug. Is this your concern compatibility with Windows?
Yes, the keys are the same whatever the operating system, and I'm concerned that giving them different names will mean that things will work on one operating system but not another.
See Also: → 936319
This bug should be fixed by 4 patches. The 4th patch's spec is still unstable because I'm waiting a reply from D3E WG members.

The first, second and third patches must be stable.
Attachment #8448558 - Attachment is obsolete: true
This patch makes "Super", "Hyper" and "OS" modifier states shared. I.e., one of them is active, all of them becomes true.
I think that this is the best approach for web apps. This patch adds a virtual modifier, "SystemAccel", which is active if a modifier state which is used for system wide shortcut keys is active.

Web apps can ignore all key/mouse events like:

function eventHandler(event)
{
  if (event.getModifierState("SystemAccel")) {
    return;
  }
  // Do something
}
Spec bug:
When .getModifierState("OS") should be true? 
https://www.w3.org/Bugs/Public/show_bug.cgi?id=26218
No longer blocks: 900372
Summary: Support "Super" and "Hyper" modifier state on Linux → [UI Events] Support "Super" and "Hyper" modifier state on Linux
Chromium is now completely not using "Super" and "Hyper" as KeyboardEvent.key value nor modifier state. So, we should stop using them.
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.