[uievents] When .getModifierState("OS") should be true? (#28)

Copied from W3C Bugzilla: https://www.w3.org/Bugs/Public/show_bug.cgi?id=26218

##### Masayuki Nakano 2014-06-27 05:56:41 UTC
I believe that .getModifierState("OS") should be enabled only when "OS" key activates a modifier state, strictly.

However, this means that .getModifierState("OS") can be true only on Windows since "OSLeft" and "OSRight" are typically "Super" (or "Hyper") on Linux (I confirmed this mapping on Ubuntu 14.04 and Fedora 20).

Therefore, even if Linux users use PC keyboard, pressing "OSLeft" or "OSRight" key activates only "Super" modifier. I.e., .getModifierState("OS") is false on Linux and .getModifierState("Super") is true.


Firefox's Linux widget module owner concerned about this difference between Linux and Windows. If web application developers check .getModifierState("OS") and test it only on Windows, Linux users who are minority than Windows users cannot use such application like Windows users.

So, if we take a hack for this issue, it might be better to activate "OS" virtual modifier state on Linux when "Super" modifier is activated.

See also https://bugzilla.mozilla.org/show_bug.cgi?id=1023067

##### Comment 1 Masayuki Nakano 2014-07-01 07:15:51 UTC
Alternative idea is, "Super" and "Hyper" are typically used as system wide acceleration key. Therefore, Defining "SystemAccel" virtual modifier might be good. Then, we applications can ignore all key events which should NOT be consumed by applications (including web apps).

##### Comment 2 Gary Kacmarcik 2014-07-09 00:55:39 UTC
Proposed text for SystemAccel (per 8July2014 confcall)

For platforms that define a separate system level accelerator modifier key (eg: Windoes, Linux), the SystemAccel virtual modifier is set whenever the system level accelerator modifier is set. For platforms that do not have a separate system level accelerator key (eg: Mac) this virtual key is never set.

##### Comment 3 Masayuki Nakano 2014-07-09 01:27:34 UTC
SGTM. If D3E explains the use case, adding "This is useful for ignoring all key events when a system level accelerator modifier key is down."

##### Comment 4 Masayuki Nakano 2015-01-14 01:49:05 UTC
See also: http://www.w3.org/2014/07/09-webapps-minutes.html

##### Comment 5 Karl Tomlinson 2015-01-22 23:58:27 UTC
(In reply to Masayuki Nakano from comment #3)
> SGTM. If D3E explains the use case, adding "This is useful for ignoring all
> key events when a system level accelerator modifier key is down."


The system will usually prevent the key events from reaching the app if they
form a system-wide shortcut, so I don't think the app need check whether the
SystemAccel virtual modifier is set.  That may mean there is no need for
a SystemAccel feature.

The only exception might be that the events around press and release of the
key activating and deactivating the modifier would be sent to the app.
However, the modifier would be present on either the press or release event,
not both, so the value here is still limited.

##### Comment 6 Karl Tomlinson 2015-01-23 00:01:32 UTC
My original concern was as follows:  "Super" is a somewhat archaic name for a
key deriving from lisp keyboards [1].  These days it is most similar in use to
the Windows key, and probably would have been called "WIN" or "OS" or similar,
except that there didn't seem to be any need to add yet another name when
"Super" was already available.  See [2] for a bit of an overview.

[1] http://home.comcast.net/~mmcm/kbd/SpaceCadet.html
[2] http://askubuntu.com/questions/19558/what-are-the-meta-super-and-hyper-keys

Similarly now, my feeling is that there is no need to add "Super" as there is
already "OS" available.  (I don't really care about "Hyper".  It's use would
be obscure.)

This is similar to the issue raised bug 22073 comment 0, only that "Super" is
more similar in functionality to "OS" than "Meta" is to "OS".

##### Comment 7 Masayuki Nakano 2015-01-28 01:30:24 UTC
(In reply to Karl Tomlinson from comment #5)
> (In reply to Masayuki Nakano from comment #3)
> > SGTM. If D3E explains the use case, adding "This is useful for ignoring all
> > key events when a system level accelerator modifier key is down."
> 
> The system will usually prevent the key events from reaching the app if they
> form a system-wide shortcut, so I don't think the app need check whether the
> SystemAccel virtual modifier is set.  That may mean there is no need for
> a SystemAccel feature.


I don't think so. Such behavior isn't guaranteed on all Linux distributions. And also web apps may want to ignore key events while system accel modifier is active. For example, they may want to ignore such key events because of not inputting character.

(In reply to Karl Tomlinson from comment #6)
> My original concern was as follows:  "Super" is a somewhat archaic name for a
> key deriving from lisp keyboards [1].  These days it is most similar in use
> to
> the Windows key, and probably would have been called "WIN" or "OS" or
> similar,
> except that there didn't seem to be any need to add yet another name when
> "Super" was already available.  See [2] for a bit of an overview.
> 
> [1] http://home.comcast.net/~mmcm/kbd/SpaceCadet.html
> [2]
> http://askubuntu.com/questions/19558/what-are-the-meta-super-and-hyper-keys
> 
> Similarly now, my feeling is that there is no need to add "Super" as there is
> already "OS" available.  (I don't really care about "Hyper".  It's use would
> be obscure.)


As far as I know, Hyper is also used by major distributions about a coupe of years ago. And Linux can map "Super" and "Hyper" different physical keys and different modifier flags.

I know it's not a usual settings but it's important to be possible. In such case, the mapping rule becomes impossible to map them.

Additionally, it's also not guaranteed that "Super" is used as "OS" key.

The most important merit of defining "Super" and "Hyper" as modifier key and defining "SystemAccel" is that this way never fails in any situations. This means that browsers keep the compatibility with the others (including its different OS version).

> This is similar to the issue raised bug 22073 comment 0, only that "Super" is
> more similar in functionality to "OS" than "Meta" is to "OS".


Yes, however, it means that we already have a problem, web apps need to check the OS for distinguishing the ideal behavior of "OS" and "Meta". So, adding "Super" and "Hyper" shouldn't cause new issue.

For web apps, "Accel" and "SystemAccel" are useful because they work independently from OS.

##### Comment 8 Arthur Barstow 2015-03-21 15:12:05 UTC
Bulk move of all D3E bugs to the UI Events component.


---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/uievents/issues/28

Received on Wednesday, 7 October 2015 04:11:45 UTC