RDK Documentation (Open Sourced RDK Components)
IrInputRemoteKeyCodes.h
Go to the documentation of this file.
1 /*
2  * If not stated otherwise in this file or this component's Licenses.txt file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2018 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 
20 /**
21 * @file IRInputRemoteKeyCodes.h
22 *
23 * @brief Map IR Remote Keys to standard Linux Input Keys.
24 *
25 * @par Document
26 * Document reference.is
27 *
28 * @par Open Issues (in no particular order)
29 * -# None
30 *
31 * @par Assumptions
32 * -# None
33 *
34 * @par Abbreviations
35 * - RDK: Reference Design Kit.
36 * - _t: Type (suffix).
37 *
38 * @par Implementation Notes
39 * -# None
40 *
41 */
42 #ifndef _IARM_IR_KEYCODES_H_
43 #define _IARM_IR_KEYCODES_H_
44 
45 
46 #include <linux/input.h>
47 #include <stdint.h>
48 #include "comcastIrKeyCodes.h"
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
54 #define _KEY_INVALID (KEY_RESERVED)
55 typedef struct
56 {
57  uint32_t iCode;
58  uint32_t uCode;
59  uint32_t uModi;
61 
62 #define IARM_TO_LINUX_KEY(iCode, uCode) { iCode, uCode, _KEY_INVALID},
63 #define IARM_TO_LINUX_CTL(iCode, uCode) { iCode, uCode, KEY_LEFTCTRL},
64 
65 
66 /*-------------------------------------------------------------------
67  End of Macro Defines
68 -------------------------------------------------------------------*/
69 static IARM_keycodes kcodesMap_IARM2Linux[] =
70 {
71  IARM_TO_LINUX_CTL( KED_MENU, KEY_M)
72  IARM_TO_LINUX_CTL( KED_GUIDE,KEY_G)
73  IARM_TO_LINUX_CTL( KED_INFO, KEY_I)
74  IARM_TO_LINUX_KEY( KED_ENTER, KEY_ENTER)
75  IARM_TO_LINUX_KEY( KED_OK, KEY_OK)
76  IARM_TO_LINUX_KEY( KED_SELECT, KEY_ENTER)
77  IARM_TO_LINUX_CTL( KED_EXIT, KEY_E)
78  IARM_TO_LINUX_KEY( KED_POWER, KEY_POWER) //FP
79  IARM_TO_LINUX_CTL( KED_CHANNELUP, KEY_UP)
80  IARM_TO_LINUX_CTL( KED_CHANNELDOWN, KEY_DOWN)
81  IARM_TO_LINUX_CTL( KED_VOLUMEUP, KEY_U)
82  IARM_TO_LINUX_CTL( KED_VOLUMEDOWN, KEY_D)
83  IARM_TO_LINUX_CTL( KED_MUTE, KEY_Y)
84  IARM_TO_LINUX_KEY( KED_DIGIT1, KEY_1)
85  IARM_TO_LINUX_KEY( KED_DIGIT2, KEY_2)
86  IARM_TO_LINUX_KEY( KED_DIGIT3, KEY_3)
87  IARM_TO_LINUX_KEY( KED_DIGIT4, KEY_4)
88  IARM_TO_LINUX_KEY( KED_DIGIT5, KEY_5)
89  IARM_TO_LINUX_KEY( KED_DIGIT6, KEY_6)
90  IARM_TO_LINUX_KEY( KED_DIGIT7, KEY_7)
91  IARM_TO_LINUX_KEY( KED_DIGIT8, KEY_8)
92  IARM_TO_LINUX_KEY( KED_DIGIT9, KEY_9)
93  IARM_TO_LINUX_KEY( KED_DIGIT0, KEY_0)
94  IARM_TO_LINUX_CTL( KED_FASTFORWARD, KEY_F)
95  IARM_TO_LINUX_CTL( KED_REWIND, KEY_W)
96  IARM_TO_LINUX_CTL( KED_PAUSE, KEY_P)
97  IARM_TO_LINUX_CTL( KED_PLAY, KEY_P)
98  IARM_TO_LINUX_CTL( KED_STOP, KEY_S)
99  IARM_TO_LINUX_CTL( KED_RECORD, KEY_R)
100  IARM_TO_LINUX_KEY( KED_ARROWUP, KEY_UP)
101  IARM_TO_LINUX_KEY( KED_ARROWDOWN, KEY_DOWN)
102  IARM_TO_LINUX_KEY( KED_ARROWLEFT, KEY_LEFT)
103  IARM_TO_LINUX_KEY( KED_ARROWRIGHT, KEY_RIGHT)
104  IARM_TO_LINUX_KEY( KED_PAGEUP, KEY_PAGEUP)
105  IARM_TO_LINUX_KEY( KED_PAGEDOWN, KEY_PAGEDOWN)
106  IARM_TO_LINUX_CTL( KED_LAST, KEY_L)
107  IARM_TO_LINUX_CTL( KED_FAVORITE, KEY_N)
108  IARM_TO_LINUX_CTL( KED_KEYA, KEY_0)
109  IARM_TO_LINUX_CTL( KED_KEYB, KEY_1)
110  IARM_TO_LINUX_CTL( KED_KEYC, KEY_2)
111  IARM_TO_LINUX_CTL( KED_KEYD, KEY_3)
112  IARM_TO_LINUX_KEY( KED_HELP, KEY_HELP)
113  IARM_TO_LINUX_KEY( KED_SETUP, KEY_SETUP)
114  IARM_TO_LINUX_KEY( KED_NEXT, KEY_NEXT)
115  IARM_TO_LINUX_KEY( KED_PREVIOUS, KEY_PREVIOUS)
116  IARM_TO_LINUX_CTL( KED_ONDEMAND, KEY_O)
117  IARM_TO_LINUX_CTL( KED_REPLAY, KEY_B)
118  IARM_TO_LINUX_CTL( KED_SEARCH, KEY_C)
119  IARM_TO_LINUX_KEY( KED_PROGRAM, KEY_KPASTERISK)
120 
121 
122  IARM_TO_LINUX_KEY( KED_UNDEFINEDKEY, KEY_UNKNOWN)
123 };
124 
125 #ifdef __cplusplus
126 }
127 #endif
128 
129 #endif /* _IARM_IR_KEYCODES_H_ */
130 
131 
132 /* End of IARM_BUS_IRMGR_API doxygen group */
133 /**
134  * @}
135  */
136 
137 
138 /** @} */
139 /** @} */
IARM_keycodes
Definition: IrInputRemoteKeyCodes.h:55