diff options
Diffstat (limited to 'utils/nwztools/plattools/nwz_keys.h')
-rw-r--r-- | utils/nwztools/plattools/nwz_keys.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/utils/nwztools/plattools/nwz_keys.h b/utils/nwztools/plattools/nwz_keys.h new file mode 100644 index 0000000000..8228e5b620 --- /dev/null +++ b/utils/nwztools/plattools/nwz_keys.h | |||
@@ -0,0 +1,60 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2016 Amaury Pouly | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | #ifndef __NWZ_KEYS_H__ | ||
22 | #define __NWZ_KEYS_H__ | ||
23 | |||
24 | /* The Sony icx_key driver reports keys via the /dev/input/event0 device and | ||
25 | * abuses the standard struct input_event. The input_event.code is split into | ||
26 | * two parts: | ||
27 | * - one part giving the code of the key just pressed/released | ||
28 | * - one part is a bitmap of various keys (such as HOLD) | ||
29 | * The status of the HOLD can be queried at any time by reading the state of | ||
30 | * the first LED. | ||
31 | */ | ||
32 | |||
33 | /* key code and mask */ | ||
34 | #define NWZ_KEY_MASK 0x1f | ||
35 | #define NWZ_KEY_PLAY 0 | ||
36 | #define NWZ_KEY_RIGHT 1 | ||
37 | #define NWZ_KEY_LEFT 2 | ||
38 | #define NWZ_KEY_UP 3 | ||
39 | #define NWZ_KEY_DOWN 4 | ||
40 | #define NWZ_KEY_ZAPPIN 5 | ||
41 | #define NWZ_KEY_AD0_6 6 | ||
42 | #define NWZ_KEY_AD0_7 7 | ||
43 | /* special "key" when event is for bitmap key, like HOLD */ | ||
44 | #define NWZ_KEY_NONE 15 | ||
45 | #define NWZ_KEY_VOL_DOWN 16 | ||
46 | #define NWZ_KEY_VOL_UP 17 | ||
47 | #define NWZ_KEY_BACK 18 | ||
48 | #define NWZ_KEY_OPTION 19 | ||
49 | #define NWZ_KEY_BT 20 | ||
50 | #define NWZ_KEY_AD1_5 21 | ||
51 | #define NWZ_KEY_AD1_6 22 | ||
52 | #define NWZ_KEY_AD1_7 23 | ||
53 | |||
54 | /* bitmap of other things */ | ||
55 | #define NWZ_KEY_NMLHP_MASK 0x20 | ||
56 | #define NWZ_KEY_NCHP_MASK 0x40 | ||
57 | #define NWZ_KEY_HOLD_MASK 0x80 | ||
58 | #define NWZ_KEY_NC_MASK 0x100 | ||
59 | |||
60 | #endif /* __NWZ_KEYS_H__ */ | ||