Handling Tizen TV remote key events is essential for the smooth functioning of the app with the intended keys being controlled with the developer provided logic. In the previous article, we saw about the basic flow needed for handling a remote key event. This article provides some of the additional options related to remote key event handling in Tizen TV. There are additional options like registering multiple keys, keys with multiple actions, keys with default handling etc. We will look into a general overview of the all the extra options that are associated to remote key event handling in Tizen TV.
Registering batch keys
In the previous blog we saw in the normal flow of handling a remote key event in Tizen TV. The intended keys should registered with the application and then handled with the necessary logic. This process is okay for a few keys. The registerKeyBatch function comes to the rescue. It saves the developer from writing code for registering multiple keys using a single function. This function accepts the intended keys as an array and then registers them all as a single batch. The following code shows the usage.
Types of remote control
There are basically two types of remotes in Tizen TV. The type of remote that is provided with the TV is based on the TV model. For UHD and higher models the Smart remote is provided whereas on the other TV models a basic remote is provided. The smart remote has only a few basic essential buttons. The number keys are accessed on screen in TV. The basic remote control has an all switch key interface.
Double action keys
There are certain keys in the Tizen TV remote that has double functionality based on the way they are pressed. For a single tap or press they will have one functionality and for long press they will have another functionality. The long press events cannot be handled via code and this functionality is there only for a limited set of keys. The following table lists down the keys and their single press vs a long press functionality.
|Key||Keyname click||Keyname long press|
|Key||Keyname click||Keyname long press|
Getting the key names
There are various models of Tizen TV. Each of them have their own set of features. The same applies to the type of remotes that are supported and as well as the keys that can be handled by the applications. So when developing our applications for a wide variety of TV models, we need to figure out the list of keys that can be handled by the specific TV model. Tizen TV SDK provides a method to find out the supported keys for the specific TV model.
var value = tizen.tvinputdevice.getSupportedKeys(); console.log(value);
This method will list out the supported keys and their codes for the specific TV model in which the application is installed. The application developer can use this list to ensure that all the keys registered for the smooth functioning of the application are supported in the current TV model. If any of the required keys are not supported for the current Tizen TV model, then the developer can use any other alternatives or can display an error message on the same.
Default handled keys
The default flow to handle key events is to register the keys either individually or by batch and then attaching handlers to them. There are some keys that does not need registration and they are handled by default. The following are those keys
These keys belong to the basic set of keys that keeps the overall navigation between apps like open an app, exit an app, accessing app menus, general TV menus etc.
List of key codes
There is a key code to each key. The key code identifies the key pressed inside the handler function. The following link provides the list of key codes for reference
Coming up next
This article provided an overall info regarding the additional options that are related to the basic key event handling for Tizen TV remote. We went into each options and saw a brief walkaround for all the additional options. It would be great if we see something in action rather than just going through the concepts all through theory. So the next article, we will try to point out the learned concepts so far in a video, so that things get a little bit more interesting.