PageRenderTime 10ms CodeModel.GetById 1ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/src/keydef.h

http://bdremote-ng.googlecode.com/
C++ Header | 178 lines | 120 code | 13 blank | 45 comment | 0 complexity | 1831847c7b7aa0993469cb2ed19fdbda MD5 | raw file
  1/*
  2 *  bdremoteng - helper daemon for Sony(R) BD Remote Control
  3 *  Based on bdremoted, written by Anton Starikov <antst@mail.ru>.
  4 *
  5 *  Copyright (C) 2009  Michael Wojciechowski <wojci@wojci.dk>
  6 *
  7 *
  8 *  This program is free software; you can redistribute it and/or modify
  9 *  it under the terms of the GNU General Public License as published by
 10 *  the Free Software Foundation; either version 2 of the License, or
 11 *  (at your option) any later version.
 12 *
 13 *  This program is distributed in the hope that it will be useful,
 14 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 15 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 16 *  GNU General Public License for more details.
 17 *
 18 *  You should have received a copy of the GNU General Public License
 19 *  along with this program; if not, write to the Free Software
 20 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 21 *
 22 */
 23
 24/** @defgroup Keys PS3 remote key definition.
 25 *  This group contains the definition of the keys on the PS3 remote.
 26 *  @{
 27 */
 28
 29
 30/*! \file keydef.h
 31  \brief PS3 remote keys.
 32
 33  This file contains the definition of the keys on the PS3 remote
 34  and some useful defines.
 35
 36*/
 37
 38#ifndef BD_KEYDEF_H
 39#define BD_KEYDEF_H
 40
 41#include <stdint.h>
 42
 43/** Key information. */
 44struct key_info
 45{
 46  /** The original name. */
 47  const char* name_orig;
 48  /** The LIRC namespace name. */
 49  const char* name_lirc;
 50  /** The Linux key event code. */
 51  unsigned int event_code;
 52  /** The code. */
 53  unsigned int code;
 54  /** The mask. */
 55  uint32_t mask;
 56};
 57
 58#define KEY_ENTER		28
 59#define KEY_POWER		116
 60#define KEY_SELECT		0x161
 61#define BTN_C			0x132
 62#define BTN_Z			0x135
 63#define BTN_START		0x13b
 64#define KEY_UP			103
 65#define KEY_RIGHT		106
 66#define KEY_DOWN		108
 67#define KEY_LEFT		105
 68#define BTN_B			0x131
 69#define BTN_Y			0x134
 70#define BTN_A			0x130
 71#define BTN_X			0x133
 72#define KEY_OPTION		0x165
 73#define KEY_BACK		158
 74#define KEY_CLEAR		0x163
 75#define KEY_ZOOM		0x174
 76#define KEY_1			2
 77#define KEY_2			3
 78#define KEY_3			4
 79#define KEY_4			5
 80#define KEY_5			6
 81#define KEY_6			7
 82#define KEY_7			8
 83#define KEY_8			9
 84#define KEY_9			10
 85#define KEY_0			11
 86#define KEY_MEDIA_REPEAT	0x1b7
 87/*#define KEY_CLEAR		0x163*/
 88#define KEY_EJECTCD		161
 89#define KEY_MENU		139
 90#define KEY_TIME		0x167
 91#define KEY_PREVIOUS		0x19c
 92#define KEY_NEXT		0x197
 93#define KEY_PLAY		207
 94#define KEY_REWIND		168
 95#define KEY_FORWARD		159
 96#define KEY_STOP		128
 97#define KEY_PAUSE		119
 98#define KEY_CONTEXT_MENU	0x1b6
 99#define KEY_FRAMEBACK		0x1b4
100#define KEY_FRAMEFORWARD	0x1b5
101#define KEY_SUBTITLE		0x172
102#define KEY_AUDIO		0x188
103#define KEY_ANGLE		0x173
104#define KEY_INFO		0x166
105#define KEY_BLUE		0x191
106#define KEY_RED			0x18e
107#define KEY_GREEN		0x18f
108#define KEY_YELLOW		0x190
109
110/** The code for a key release. */
111#define ps3remote_keyup 0xFF
112/** Undefined key. */
113#define ps3remote_undef -1
114
115/** The max number of keys. */
116#define ps3remote_num_keys   51
117#define ps3remote_num_masked 18
118
119/** Array of keys. */
120static struct key_info ps3remote_keys[] =
121  {
122    {"enter\0"   , "KEY_ENTER\0"       , KEY_ENTER       , 0x0b, 0x080000},
123    {"ps\0"      , "KEY_POWER\0"       , KEY_POWER       , 0x43, 0x010000},
124    {"select\0"  , "KEY_SELECT\0"      , KEY_SELECT      , 0x50, 0x000001},
125    {"l3\0"      , "BTN_C\0"           , BTN_C           , 0x51, 0x000002},
126    {"r3\0"      , "BTN_Z\0"           , BTN_Z           , 0x52, 0x000004},
127    {"start\0"   , "BTN_START\0"       , BTN_START       , 0x53, 0x000008},
128    {"up\0"      , "KEY_UP\0"          , KEY_UP          , 0x54, 0x000010},
129    {"right\0"   , "KEY_RIGHT\0"       , KEY_RIGHT       , 0x55, 0x000020},
130    {"down\0"    , "KEY_DOWN\0"        , KEY_DOWN        , 0x56, 0x000040},
131    {"left\0"    , "KEY_LEFT\0"        , KEY_LEFT        , 0x57, 0x000080},
132    {"l2\0"      , "BTN_B\0"           , BTN_B           , 0x58, 0x000100},
133    {"r2\0"      , "BTN_Y\0"           , BTN_Y           , 0x59, 0x000200},
134    {"l1\0"      , "BTN_A\0"           , BTN_A           , 0x5a, 0x000400},
135    {"r1\0"      , "BTN_X\0"           , BTN_X           , 0x5b, 0x000800},
136    {"triangle\0", "KEY_OPTION\0"      , KEY_OPTION      , 0x5c, 0x001000},
137    {"circle\0"  , "KEY_BACK\0"        , KEY_BACK        , 0x5d, 0x002000},
138    {"cross\0"   , "KEY_CLEAR\0"       , KEY_CLEAR       , 0x5e, 0x004000},
139    {"square\0"  , "KEY_ZOOM\0"        , KEY_ZOOM        , 0x5f, 0x008000},
140    {"num1\0"    , "KEY_1\0"           , KEY_1           , 0x00, 0x000000},
141    {"num2\0"    , "KEY_2\0"           , KEY_2           , 0x01, 0x000000},
142    {"num3\0"    , "KEY_3\0"           , KEY_3           , 0x02, 0x000000},
143    {"num4\0"    , "KEY_4\0"           , KEY_4           , 0x03, 0x000000},
144    {"num5\0"    , "KEY_5\0"           , KEY_5           , 0x04, 0x000000},
145    {"num6\0"    , "KEY_6\0"           , KEY_6           , 0x05, 0x000000},
146    {"num7\0"    , "KEY_7\0"           , KEY_7           , 0x06, 0x000000},
147    {"num8\0"    , "KEY_8\0"           , KEY_8           , 0x07, 0x000000},
148    {"num9\0"    , "KEY_9\0"           , KEY_9           , 0x08, 0x000000},
149    {"num0\0"    , "KEY_0\0"           , KEY_0           , 0x09, 0x000000},
150    {"return\0"  , "KEY_MEDIA_REPEAT\0", KEY_MEDIA_REPEAT, 0x0e, 0x000000},
151    {"clear\0"   , "KEY_CLEAR\0"       , KEY_CLEAR       , 0x0f, 0x000000},
152    {"eject\0"   , "KEY_EJECTCD\0"     , KEY_EJECTCD     , 0x16, 0x000000},
153    {"topmenu\0" , "KEY_MENU\0"        , KEY_MENU        , 0x1a, 0x000000},
154    {"time\0"    , "KEY_TIME\0"        , KEY_TIME        , 0x28, 0x000000},
155    {"prev\0"    , "KEY_PREVIOUS\0"    , KEY_PREVIOUS    , 0x30, 0x000000},
156    {"next\0"    , "KEY_NEXT\0"        , KEY_NEXT        , 0x31, 0x000000},
157    {"play\0"    , "KEY_PLAY\0"        , KEY_PLAY        , 0x32, 0x000000},
158    {"scanrev\0" , "KEY_REWIND\0"      , KEY_REWIND      , 0x33, 0x000000},
159    {"scanfwd\0" , "KEY_FORWARD\0"     , KEY_FORWARD     , 0x34, 0x000000},
160    {"stop\0"    , "KEY_STOP\0"        , KEY_STOP        , 0x38, 0x000000},
161    {"pause\0"   , "KEY_PAUSE\0"       , KEY_PAUSE       , 0x39, 0x000000},
162    {"popup\0"   , "KEY_CONTEXT_MENU\0", KEY_CONTEXT_MENU, 0x40, 0x000000},
163    {"steprev\0" , "KEY_FRAMEBACK\0"   , KEY_FRAMEBACK   , 0x60, 0x000000},
164    {"stepfwd\0" , "KEY_FRAMEFORWARD\0", KEY_FRAMEFORWARD, 0x61, 0x000000},
165    {"subtitle\0", "KEY_SUBTITLE\0"    , KEY_SUBTITLE    , 0x63, 0x000000},
166    {"audio\0"   , "KEY_AUDIO\0"       , KEY_AUDIO       , 0x64, 0x000000},
167    {"angle\0"   , "KEY_ANGLE\0"       , KEY_ANGLE       , 0x65, 0x000000},
168    {"display\0" , "KEY_INFO\0"        , KEY_INFO        , 0x70, 0x000000},
169    {"blue\0"    , "KEY_BLUE\0"        , KEY_BLUE        , 0x80, 0x000000},
170    {"red\0"     , "KEY_RED\0"         , KEY_RED         , 0x81, 0x000000},
171    {"green\0"   , "KEY_GREEN\0"       , KEY_GREEN       , 0x82, 0x000000},
172    {"yellow\0"  , "KEY_YELLOW\0"      , KEY_YELLOW      , 0x83, 0x000000},
173  };
174
175#endif /* BD_KEYDEF_H */
176
177/*@}*/
178