The Keyset class
Support in HbbTV
Available since: HbbTV 1.0 (ETSI TS 102 796 V1.1.1, OIPF DAE V1.1)
For terminals not making the VK_RECORD key event available to HbbTV® applications, the otherKeys and maximumOtherKeys properties are not included.
For terminals making the VK_RECORD key event available to HbbTV® applications, the otherKeys and maximumOtherKeys properties shall be supported and applications shall be able to request the VK_RECORD key event using them. The getKeyLabel method is not included. The icons returned by the getKeyIcon method shall be 32 x 32 pixels.
The Keyset object permits applications to define which key events they request to receive. There are two means of defining this. Common key events are represented by constants defined in this class which are combined in a bit-wise mask to identify a set of key events. Less common key events are not included in one of the defined constants and form part of an array.
The supported key events indicated through the capability mechanism in section 9.3 SHALL be the same as the maximum set of key events available to the browser as indicated through this object
The default set of key events available to broadcast-related applications shall be none. The default set of key events available to broadcast-independent or service provider related applications which do not call Keyset.setValue() SHALL be all those indicated by the constants in this class which are supported by the OITF excluding those indicated by OTHER.
Constants
Constant name | Numeric Value | Use |
RED | 0x1 | Used to identify the VK_RED key event. |
GREEN | 0x2 | Used to identify the VK_GREEN key event. |
YELLOW | 0x4 | Used to identify the VK_YELLOW key event. |
BLUE | 0x8 | Used to identify the VK_BLUE key event. |
NAVIGATION | 0x10 | Used to identify the VK_UP, VK_DOWN, VK_LEFT, VK_RIGHT, VK_ENTER and VK_BACK key events. |
VCR | 0x20 | Used to identify the VK_PLAY, VK_PAUSE, VK_STOP, VK_NEXT, VK_PREV, VK_FAST_FWD, VK_REWIND, VK_PLAY_PAUSE key events. |
SCROLL | 0x40 | Used to identify the VK_PAGE_UP and VK_PAGE_DOWN key events. |
INFO | 0x80 | Used to identify the VK_INFO key event. |
NUMERIC | 0x100 | Used to identify the number events, 0 to 9. |
ALPHA | 0x200 | Used to identify all alphabetic events. |
OTHER | 0x400 | Used to indicate key events not included in one of the other constants in this class. |
Properties
readonly Integer value |
The value of the keyset which this DAE application will receive. |
readonly Integer otherKeys[ ] |
If the OTHER bit in the value property is set then this indicates those key events which are available to the browser which are not included in one of the constants defined in this class, If the OTHER bit in the value property is not set then this property is meaningless. |
readonly Integer maximumValue |
In combination with maximumOtherKeys, this indicates the maximum set of key events which are available to the browser. When a bit in this maximumValue has value 0, the corresponding key events are never available to the browser. |
readonly Integer maximumOtherKeys[ ] |
If the OTHER bit in the maximumValue property is set then, in combination with maximumValue, this indicates the maximum set of key events which are available to the browser. For key events which are not included in one of the constants defined in this class, if they are not listed in this array then they are never available to the browser. If the OTHER bit in the value property is not set then this property is meaningless. |
Boolean supportsPointer |
Applications that have been designed to handle Mouse Events can express it by using this property. Applications SHALL set this property to true to indicate that they support a pointer based interaction model, i.e. that they listen to and handle Mouse Events as included in the Web Standards TV profile [OIPF_DAE2_WEB]. They SHALL set it to false otherwise. If not set, an OITF SHALL assume that the application does not support a pointer based interaction model. Based on the value of this property, an OITF MAY decide to enable or disable the rendering of a free moving cursor. Note: OITFs are not required to support a pointer based input device even though they are recommended to do so. If pointer based input devices are supported, this is expressed via the +POINTER UI Profile fragment as described in section 9.2. |
Methods
Integer setValue( Integer value, Integer otherKeys[ ] ) |
Description | Sets the value of the keyset which this DAE application requests to receive. Where more than one DAE application is running, the events delivered to the browser SHALL be the union of the events requested by all running DAE applications. Under these circumstances, applications may receive events which they have not requested to receive. The return value indicates which keys will be delivered to this DAE application encoded as bit-wise mask of the constants defined in this class. |
Arguments | value | The value is a number which is a bit-wise mask of the constants defined in this class. For example; myKeyset = myApplication.privateData.keyset; myKeyset.setValue(0x00000013); myKeyset.setValue(myKeyset.INFO | myKeyset.NUMERIC); |
otherkeys | This parameter is optional. If the value parameter has the OTHER bit set then it is used to indicate the key events that the application wishes to receive which are not represented by constants defined in this class. |
String getKeyIcon( Integer code ) |
Description | Return the URI of the icon representing the physical key or other mechanism that is used by the terminal to generate the key event for the given keycode passed. It SHALL return null if the key has no icon associated with it. |
Arguments | code | The VK_ constant for the key whose icon should be returned. |
String getKeyLabel( Integer code ) |
Description | Return the textual label representing the physical key or other mechanism that is used by the terminal to generate the key event for the given keycode passed. It SHALL return null if the key has no textual label associated with it. |
Arguments | code | The VK_ constant for the key whose textual label should be returned. |