1 #ifndef LEARN_KEYS_H 2 #define LEARN_KEYS_H 3 4 #include "coolwidget.h" 5 6 /* each command can be bound to three different keys */ 7 struct key_list { 8 char key_name[64]; 9 int command; 10 unsigned int keycode0, state0; 11 unsigned int keycode1, state1; 12 unsigned int keycode2, state2; 13 }; 14 15 #ifndef EDIT_OPTIONS_C 16 extern struct key_list klist[]; 17 #endif 18 19 int get_defined_key (struct key_list k_list[], unsigned int state, unsigned int keycode); 20 char *find_section (char *t, const char *section); 21 22 #ifdef HAVE_MAD 23 #define get_options_section(f,s) mad_get_options_section(f,s,__FILE__,__LINE__) 24 char *mad_get_options_section (const char *file, const char *section, char *cfile, int line); 25 #else 26 char *get_options_section (const char *file, const char *section); 27 #endif 28 29 int save_options_section (const char *file, const char *section, const char *text); 30 int load_user_defined_keys (struct key_list k_list[], const char *file); 31 int save_user_defined_keys (struct key_list k_list[], const char *file); 32 CWidget *Cdrawlearnkeys (Window parent, int x, int y, int width, int height); 33 int user_defined_key (unsigned int state, unsigned int keycode, KeySym keysym); 34 int load_keys (const char *file); 35 void draw_switches_dialog (Window parent, int x, int y); 36 struct key_list *get_command_list (void); 37 38 #endif /* LEARN_KEYS_H */ 39