Closed
Bug 1147775
Opened 9 years ago
Closed 9 years ago
Add new DOM keys(e.g. Media Controller Keys)
Categories
(Core :: DOM: Events, defect)
Core
DOM: Events
Tracking
()
People
(Reporter: chunmin, Unassigned)
References
Details
With the coming of new firefox products like FxOS TV, we need add more DOM Keys such as 'ChannelDown', 'ChannelUp', 'Color*' in [1]. [1] http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-media-controller
Reporter | ||
Updated•9 years ago
|
Summary: Add new KeyboardEvent key Values(e.g. Media Controller Keys) → Add new DOM keys(e.g. Media Controller Keys)
Reporter | ||
Updated•9 years ago
|
Blocks: conn_priority
Reporter | ||
Comment 1•9 years ago
|
||
The keys(new keyName) introduced in DOM 3 are already added in [1] by Masayuki in bug 1119609, so we can get the corrsponding keyName from NativeKeyCode[2]. However, the corresponding DOMKeyCode has not been implemented yet. We need to add the new keys in DOM3 to kKeyMapping[3] and define VirtualKeyCode in [4] with a proper DOMKeyCode[5] when we try to convert the NativeKeyCode into DOMKeyCode[6]. [1] https://dxr.mozilla.org/mozilla-central/source/dom/events/KeyNameList.h [2] https://dxr.mozilla.org/mozilla-central/source/widget/gonk/nsAppShell.cpp#262 [3] https://dxr.mozilla.org/mozilla-central/source/widget/gonk/GonkKeyMapping.h#26 [4] https://dxr.mozilla.org/mozilla-central/source/dom/events/VirtualKeyCodeList.h [5] https://dxr.mozilla.org/mozilla-central/source/dom/interfaces/events/nsIDOMKeyEvent.idl [6] https://dxr.mozilla.org/mozilla-central/source/widget/gonk/nsAppShell.cpp#260
Reporter | ||
Comment 2•9 years ago
|
||
> NativeKeyCode --> DOMKeyCode ==> it's platform-dependent > NativeKeyCode --> DOMKeyName ==> it's platform-dependent The conversion of getting DOMKeyName and DOMKeyCode both are platform-dependent now. If one DOMKeyCode is only mapped to one DOMKeyName, why don't we we just get DOMKeyCode from NativeKeyCode, and map DOMKeyCode to DOMKeyName? That is: > NativeKeyCode --> DOMKeyCode --> DOMKeyName By above, the conversion to get DOMKeyName will be "platform-independent" and it will be easier to add a new platform to map keys' information(we only need to make a mapping table from NativeKeyCode to DOMKeyCode).
Reporter | ||
Comment 3•9 years ago
|
||
(In reply to Chun-Min Chang[:chunmin] from comment #2) > > NativeKeyCode --> DOMKeyCode ==> it's platform-dependent > > NativeKeyCode --> DOMKeyName ==> it's platform-dependent > The conversion of getting DOMKeyName and DOMKeyCode both are > platform-dependent now. > > If one DOMKeyCode is only mapped to one DOMKeyName, why don't we we just get > DOMKeyCode from NativeKeyCode, and map DOMKeyCode to DOMKeyName? That is: > > NativeKeyCode --> DOMKeyCode --> DOMKeyName > By above, the conversion to get DOMKeyName will be "platform-independent" > and it will be easier to add a new platform to map keys' information(we only > need to make a mapping table from NativeKeyCode to DOMKeyCode). Hi, Masayuki, I was wondering if you could take a look at the question on comment #2
Flags: needinfo?(masayuki)
Comment 4•9 years ago
|
||
First, don't add new keyCode values anymore. .key should be used to handle new keys. And .keyCode and .key are not related in strict speaking. .keyCode is legacy attribute, it shouldn't be used by new applications but on the other hand, it's value is important for keeping compatibility with older Gecko.
Flags: needinfo?(masayuki)
Updated•9 years ago
|
Blocks: TV_FxOS2.5
Comment 5•9 years ago
|
||
Hi Chun-Min, This will be in 2.5 scope. Could you help to mark target milestone? Thanks!
feature-b2g: --- → 2.5+
Flags: needinfo?(cchang)
Reporter | ||
Comment 6•9 years ago
|
||
(In reply to Masayuki Nakano (:masayuki) (Mozilla Japan) from comment #4) > First, don't add new keyCode values anymore. .key should be used to handle > new keys. > > And .keyCode and .key are not related in strict speaking. .keyCode is legacy > attribute, it shouldn't be used by new applications but on the other hand, > it's value is important for keeping compatibility with older Gecko. 1) NativeKeyCode --> DOMKeyCode ==> it's platform-dependent 2) NativeKeyCode --> DOMKeyName ==> it's platform-dependent Ok, so we don't need to implement the path 1 above when we try to add new key, right? we only need to add new keyname for event.key. I'll check all keys that might be used in 2.5 scope on path 2
Flags: needinfo?(cchang)
Reporter | ||
Updated•9 years ago
|
Target Milestone: --- → FxOS-S5 (21Aug)
Reporter | ||
Comment 7•9 years ago
|
||
Most keys that are used in 2.5 already can be converted to DOMKeyName from their NativeKeyCode.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•