2 * buttons.h - button api header file
4 * author: hackbard@hackdaworld.org
16 #define BUTTON_INT (1<<0)
17 #define BUTTON_POLL (1<<1)
20 typedef struct s_button {
21 unsigned char mode; // mode of the button api
22 int retries; // amount of retries per event capture
23 unsigned char cnt; // amount of recognized key presses
24 unsigned char key[BUTTON_MAX]; // pressed keys
27 /* function prototypes */
28 void button_init(t_button *button);
29 void button_set_retries(t_button *button,int retries);
30 unsigned char button_get_event(t_button *button);
32 /* button definitions */
37 #define BUTTON_BETTY 0x0a
38 #define BUTTON_EXIT 0x14
39 #define BUTTON_UP 0x09
40 #define BUTTON_DOWN 0x1b
41 #define BUTTON_RIGHT 0x0e
42 #define BUTTON_LEFT 0x0f
43 #define BUTTON_OK 0x15
44 #define BUTTON_VOL_UP 0x10
45 #define BUTTON_VOL_DOWN 0x16
46 #define BUTTON_PRG_UP 0x1a
47 #define BUTTON_PRG_DOWN 0x20
48 #define BUTTON_MUTE 0x21
58 #define BUTTON_SHIFT 0x17
60 #define BUTTON_AV 0x0d
61 #define BUTTON_MENU 0x1c
62 #define BUTTON_PIP 0x1d
63 #define BUTTON_A_B 0x12
64 #define BUTTON_16_9 0x13
65 #define BUTTON_INFO 0x22
66 #define BUTTON_TV1 0x23
67 #define BUTTON_TV2 0x18
68 #define BUTTON_TV3 0x19
69 #define BUTTON_RED 0x28
70 #define BUTTON_GREEN 0x29
71 #define BUTTON_YELLOW 0x1e
72 #define BUTTON_BLUE 0x1f
73 #define BUTTON_TV 0x24
74 #define BUTTON_POWER 0x25