- From: Yosuke Funahashi <yfuna@tomo-digi.co.jp>
- Date: Fri, 28 Sep 2012 00:52:47 +0900
- To: www-dom@w3.org
Hi all,
I've reviewed DOM3 Events WD with some broadcasters and CE manufactures from the practical viewpoint of using the spec to implement TV set with a web browser. We found that the spec looks good for that purpose basically, but it can be better if we modify it a little bit about key events. Let me explain.
1. Additional key values for media remote control
* Motivation
Almost all TV remotes have ten-key-like buttons. (Please see images on http://en.wikipedia.org/wiki/Remote_control . You can check remotes in other countries by changing language.) Nonetheless, the WD contains no key values for them. Therefore, web application developers can't use the buttons as a UI for their web apps on TV set. [1]
Probably, one of the reason why the spec lacks the key values for the buttons is that the semantics (default actions) of the buttons are device-dependent, region-dependent and even context-sensitive. However, from the viewpoint of web app developers, the use case of ten-key-like buttons is simple: "Using them as a ten key or numeric pad to help users input numbers such as zip code, phone numbers, and card numbers".
* Proposal
I would like to propose adding following key values into the key values list in the spec. [2]
{| class="wikitable"
!Key !! Char !! Typical Usage (Informative) !! Category
|-
|'TenKeyLikeButton0' || || Typical default action is to select a channel set to this button by user or default, and typical usage on an application is to input number 0|| Media
|-
|'TenKeyLikeButton1' || || Typical default action is to select a channel set to this button by user or default, and typical usage on an application is to input number 1|| Media
|-
|'TenKeyLikeButton2' || || Typical default action is to select a channel set to this button by user or default, and typical usage on an application is to input number 2|| Media
|-
|'TenKeyLikeButton3' || || Typical default action is to select a channel set to this button by user or default, and typical usage on an application is to input number 3|| Media
|-
|'TenKeyLikeButton4' || || Typical default action is to select a channel set to this button by user or default, and typical usage on an application is to input number 4|| Media
|-
|'TenKeyLikeButton5' || || Typical default action is to select a channel set to this button by user or default, and typical usage on an application is to input number 5|| Media
|-
|'TenKeyLikeButton6' || || Typical default action is to select a channel set to this button by user or default, and typical usage on an application is to input number 6|| Media
|-
|'TenKeyLikeButton7' || || Typical default action is to select a channel set to this button by user or default, and typical usage on an application is to input number 7|| Media
|-
|'TenKeyLikeButton8' || || Typical default action is to select a channel set to this button by user or default, and typical usage on an application is to input number 8|| Media
|-
|'TenKeyLikeButton9' || || Typical default action is to select a channel set to this button by user or default, and typical usage on an application is to input number 9|| Media
|}
Here's a straw example code using one of the key events.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
<!DOCTYPE html>
<html>
<head>
<script>
function init() {
var elm = document.getElementById('zip_code');
elm.addEventListener('keydown', function(e) {
if (e.value == 'TenKeyLikeButton1') {
e.preventDefault();
elm.value += '1';
e.stopImmediatePropagation();
}
});
}
</script>
</head>
<body onload="init();">
<input id="zip_code" type="text"/>
</body>
</html>
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2. Toggling propagation of media-remote-control's key events
This topic may be out of scope of DOM3 Events spec (maybe relevant to DAP) but I would like to explain this here a little bit because it relates to the propagation of key events over DOM trees.
Basically, dealing with media-remote-control's key events using DOM3 Events on TV set means that the key events propagate over DOM trees *first*, and dispatched to a middleware or hardware *later* to take default actions if preventDefault() has not been called during propagation. This is a bit problematic because the activation of original functions (default actions) preset to the buttons as a remote for a media device has always been bound to a web browser. In other words, the reliability of media devices' original functions always depends on that of a web browser implemented on or beside them. That sounds not so good from architectural and QA viewpoint of CE devices.
To solve the problem, I would like to propose an interface for enabling and disabling propagation of specific key events.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
typedef DOMString KeyValue; // A key value listed or defined in DOM3 Events spec. or an implementation-specific key value.
typedef Sequence<KeyValue> KeyValues;
[NoInterfaceObject]
interface NavigatorMediaRemoteControlUtils {
readonly attribute KeyValues KeyEventsEnabledToFire;
void setKeyEventsEnalbledToFire(KeyValues kvs);
}
Navigator implements NavigatorMediaRemoteControlUtils;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
We are now creating more detailed proposal document on this issue and we will share it on the ML soon. Of course, any comments before that welcome. :)
[1] Actually, existing regional standards for DTV/IPTV with HTML4/XHTML2.1 as their basis have some mechanism to allow app developers to use ten-key-like buttons on remotes. For example,
* used-key-list interface in ARIB specs, http://www.arib.or.jp/english/html/overview/doc/6-STD-B24v5_2-2p3-1-E1.pdf
* KeySet interface in OIPF specs, http://www.oipf.tv/specifications/root/solution-specification-volume-5-declarative-application-environment/download
The sytanxes are different but semantics is almost identical. This is another motivation to define the interface within global standards such as DOM3 Events.
[2] http://www.w3.org/TR/2012/WD-DOM-Level-3-Events-20120906/#key-values-list
Thanks,
Yosuke
--
Yosuke Funahashi
co-Chair, W3C Web and TV Interest Group
Chair, W3C Web and Broadcasting Business Group
Researcher, Keio University Research Institute at SFC
Board Director, Tomo-Digi Corporation
Received on Thursday, 27 September 2012 15:55:34 UTC