1 /* $:ID $ 2 * keyboard handling */ 3 4 #ifndef _KEYB_H_ 5 #define _KEYB_H_ 6 7 #include "menu.h" 8 9 enum _bcplayerkeys { 10 BCPK_up = 0, 11 BCPK_down, 12 BCPK_left, 13 BCPK_right, 14 BCPK_drop, 15 BCPK_special, 16 17 BCPK_max 18 }; 19 20 enum _bckeys { 21 BCK_help = BCPK_max * 3, 22 BCK_esc, 23 BCK_fullscreen, 24 BCK_chat, 25 BCK_pause, 26 BCK_playermenu, 27 BCK_mapmenu, 28 29 BCK_max 30 }; 31 32 struct { 33 Uint8 state [BCK_max]; // current state 34 Uint8 old [BCK_max]; // old state 35 int keycode [BCK_max]; // keycode 36 } typedef BCGameKeys; 37 38 struct { 39 int drop; 40 int special; 41 } typedef BCGameJoystick; 42 43 extern BCGameKeys keyb_gamekeys; 44 extern BCGameJoystick joy_keys[2]; 45 46 extern void keyb_config (); 47 extern void keyb_config_reset (); 48 extern void keyb_config_createkeymenu (_menu *menu, int key, int x, int y, int menu_nr); 49 extern void keyb_config_readkey (int key); 50 extern void keyb_init (); 51 extern void keyb_loop (SDL_Event *event); 52 53 #endif 54