The remote control is the most common way for users to interact with the TV.
Samsung TVs can have 2 types of remote controls:
Basic remote control
The basic remote control is a traditional remote control that has, for example, number keys and colored function keys.
Samsung Smart Remote
The Samsung Smart Remote is only supported on Samsung UHD TVs.
It has only the essential keys and some special function keys. The user can access additional virtual keys on the TV screen by clicking the "123" key.
Some remote control keys have different functions based on whether they are clicked or long-pressed:
On the basic remote control:
Key
Click Key Name
Long Press Key Name
"Rewind"
MediaRewind
MediaTrackPrevious
"Fast Forward"
MediaFastForward
MediaTrackNext
Table 1. Basic remote control key functions
NoteThe "MediaTrackPrevious" and "MediaTrackNext" keys are not supported on the emulator.
On the Samsung Smart Remote:
Key
Click Key Name
Long Press Key Name
"Back/Exit"
Back
Exit
Table 2. Samsung Smart Remote key functions
Prerequisites
To use the TVInputDevice API, the application has to request permission by adding the following privilege to the "config.xml" file:
NoteThe "ArrowLeft", "ArrowUp", "ArrowRight", "ArrowDown", "Enter", and "Back" key events are detected automatically, and do not require separate registration.
To receive notifications when a remote control key is clicked, add a listener for the keydown event:
Define the listener.
The parameter of the handleKeyDown() method is the keyCode value for the clicked key.
function handleKeydown(event) {
switch (event.keyCode) {
case tizen.tvinputdevice.getKey('MediaPlayPause').code: //10252
// Something you want to do
break;
case tizen.tvinputdevice.getKey('ColorF0Red').code: //403
// Something you want to do
break;
...
Remote Control Key Codes
The following table lists the remote control key names and their corresponding keyCode values.
Key Name
keyCode
ArrowLeft
37
ArrowUp
38
ArrowRight
39
ArrowDown
40
Enter
13
Back
10009
Key Name
keyCode
0
48
1
49
2
50
3
51
4
52
5
53
6
54
7
55
8
56
9
57
Minus
189
Key Name
keyCode
VolumeUp
447
VolumeDown
448
VolumeMute
449
ChannelUp
427
ChannelDown
428
ChannelList
10073
PreviousChannel
10190
Key Name
keyCode
MediaPlayPause
10252
MediaRewind
412
MediaFastForward
417
MediaPlay
415
MediaPause
19
MediaStop
413
MediaRecord
416
MediaTrackPrevious
10232
MediaTrackNext
10233
Key Name
keyCode
ColorF0Red
403
ColorF1Green
404
ColorF2Yellow
405
ColorF3Blue
406
Key Name
keyCode
Menu
18
Tools
10135
Info
457
Source
10072
Exit
10182
Caption
10221
E-Manual
10146
3D
10199
Extra
10253
PictureSize
10140
Soccer
10228
Teletext
10200
MTS
10195
Search
10225
Guide
458
Table 3. Remote control key codes
Manage Your Cookies
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.