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