The TV Input Device API provides functions to subscribe key events of the input device.
The following remote control keys are mandatory input device keys. They are available to an application on any Tizen TV.
ArrowLeft, ArrowUp, ArrowRight, ArrowDown
Enter
Back
The Tizen TV may provide additional keys depending on a particular input device. An application can handle device dependent key events after registration.
The name of the key, for example "VolumeUp" or "ChannelDown".
If the key is listed in the DOM Level 3 KeyboardEvent key Values specification, the name attribute is equal to the key value specified there. (The Media Controller Keys section is the most relevant to the Input Device API) If the "DOM Level 3 KeyboardEvent key Value" does not contain appropriate entry for the key, then the Input Device provides a device specific name.
Since: 2.3
readonly long code
The numeric code of the key, like 37 or 13.
This is the keyCode attribute value of the Key Event generated by the key.
Since: 2.3
2.3. TVInputDeviceManager
The TVInputDeviceManager interface provides the features to check for availability and register for input device events.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type UnknownError in case of any error.
Code example:
var i, keyCode = {}, supportedKeys;
supportedKeys = tizen.tvinputdevice.getSupportedKeys();
for (i = 0; i < supportedKeys.length; i++) {
keyCode[supportedKeys[i].name] = supportedKeys[i].code;
}
if(keyCode.hasOwnProperty("ChannelUp")) {
tizen.tvinputdevice.registerKey("ChannelUp");
}
window.addEventListener("keydown", function(keyEvent) {
// identify the key by the numeric code from the keyEvent
if(keyEvent.keyCode === keyCode.ChannelUp) {
console.log("The CHANNEL UP was pressed");
}
});
getKey
Returns information about the key which has the given name.
We use cookies to improve your experience on our website and to show you relevant
advertising. Manage you settings for our cookies below.
Essential Cookies
These cookies are essential as they enable you to move around the website. This
category cannot be disabled.
Company
Domain
Samsung Electronics
.samsungdeveloperconference.com
Analytical/Performance Cookies
These cookies collect information about how you use our website. for example which
pages you visit most often. All information these cookies collect is used to improve
how the website works.
Company
Domain
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.com
Functionality Cookies
These cookies allow our website to remember choices you make (such as your user name, language or the region your are in) and
tailor the website to provide enhanced features and content for you.
Company
Domain
LinkedIn
.ads.linkedin.com, .linkedin.com
Advertising Cookies
These cookies gather information about your browser habits. They remember that
you've visited our website and share this information with other organizations such
as advertisers.
Company
Domain
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.com
Preferences Submitted
You have successfully updated your cookie preferences.