TV specific keys in browser¶
Suitest allows the use of regular browsers for launching HbbTV and other TV apps, this is very useful for quick testing if you do not yet have access to a CandyBox or do not have access to a TV at the moment.
Important: Suitest does not create compatibility of the application with browsers or vice-versa. Your application will function exactly the same as if it is running without Suitest.
It is common for TV applications to respond to special keys that are not on a traditional keyboard such as Red, Blue, Pause, Play. That is why we need to send different key codes to the browser to replace these special keys. The applications developers need to implement, that the application can recognize these replacement keys when it is being operated with SuitestDrive.
Example: When the Back button is pressed on a remote, HbbTV expects code 461, Tizen expects 10009 and Samsung Orsay expects 88. Suitest uses code 461 as the Back button as it is the most commonly used.
As seen above in the example, using a traditional keyboard to interact with the browser will not allow the control of the application within the browser, without using replacement key codes. To create compatibility you can bind keyboard keys to TV remote buttons to allow you to control your app within the browser.
Your application will receive the following key codes when the browser is operated by SuitestDrive:
|Tv Remote Button||Key code (hex)||Key code (decimal)||Keyboard button name|
Subscribing to key events
Unfortunately browsers emit the key events inconsistently, so if you are trying to achieve consistent browser compatibility with your TV application you may need to experiment a bit until you achieve the desired behavior.
Mozilla Firefox sets the
keyCode to 0 in a
keypress event. However the
which property is set correctly.
Google Chrome comes with two surprises:
For the arrow keys the
keypressevent is not dispatched at all.
keydownevent the value of
event.charCodeis 0 for all keys from the above table.