| version 1.9 | | version 1.10 |
|---|
| | |
| * Routines to configure keyboard, joystick, etc.. | | * Routines to configure keyboard, joystick, etc.. |
| * | | * |
| * $Log$ | | * $Log$ |
| | | * Revision 1.10 2000/11/30 10:13:38 donut |
| | | * joy configuration next axis key from WraithX |
| | | * |
| * Revision 1.9 2000/10/27 04:08:33 donut | | * Revision 1.9 2000/10/27 04:08:33 donut |
| * allow up to 16 mouse buttons to be used (dependant upon arch supporting that many) | | * allow up to 16 mouse buttons to be used (dependant upon arch supporting that many) |
| * | | * |
| | |
| void kc_change_key( kc_item * item ); | | void kc_change_key( kc_item * item ); |
| void kc_change_joybutton( kc_item * item ); | | void kc_change_joybutton( kc_item * item ); |
| void kc_change_mousebutton( kc_item * item ); | | void kc_change_mousebutton( kc_item * item ); |
| | | void kc_next_joyaxis( kc_item * item ); //added by WraithX on 11/22/00 |
| void kc_change_joyaxis( kc_item * item ); | | void kc_change_joyaxis( kc_item * item ); |
| void kc_change_mouseaxis( kc_item * item ); | | void kc_change_mouseaxis( kc_item * item ); |
| void kc_change_invert( kc_item * item ); | | void kc_change_invert( kc_item * item ); |
| | |
| case BT_INVERT: kc_change_invert( &items[citem] ); break; | | case BT_INVERT: kc_change_invert( &items[citem] ); break; |
| } | | } |
| break; | | break; |
| | | //the following case added by WraithX on 11/22/00 to work around the weird joystick bug... |
| | | case KEY_SPACEBAR: |
| | | switch( items[citem].type ) { |
| | | case BT_JOY_AXIS: kc_next_joyaxis( &items[citem] ); break; |
| | | } |
| | | break; |
| | | //end addition by WraithX |
| case -2: | | case -2: |
| case KEY_ESC: | | case KEY_ESC: |
| grd_curcanv->cv_font = save_font; | | grd_curcanv->cv_font = save_font; |
| | |
| game_flush_inputs(); | | game_flush_inputs(); |
| | | |
| } | | } |
| | | |
| | | |
| | | //the following function added by WraithX on 11/22/00 to work around the weird joystick bug... |
| | | void kc_next_joyaxis( kc_item * item ) |
| | | { |
| | | int n,i,k; |
| | | ubyte code = 0; |
| | | k = 255; |
| | | n = 0; |
| | | i = 0; |
| | | |
| | | //I modelled this ifdef after the code in the kc_change_joyaxis method. |
| | | //So, if somethin's not workin here, it might not be workin there either. |
| | | #ifdef __LINUX__ |
| | | code = (item->value + 1)%32; |
| | | #else |
| | | code = (item->value + 1)%JOY_NUM_AXES; |
| | | #endif |
| | | |
| | | if (code!=255) { |
| | | for (i=0; i<Num_items; i++ ) { |
| | | n = item - All_items; |
| | | if ( (i!=n) && (All_items[i].type==BT_JOY_AXIS) && (All_items[i].value==code) ) { |
| | | All_items[i].value = 255; |
| | | kc_drawitem( &All_items[i], 0 ); |
| | | }//end if |
| | | }//end for |
| | | |
| | | item->value = code; |
| | | }//end if |
| | | |
| | | kc_drawitem( item, 1 ); |
| | | nm_restore_background( 0, INFO_Y, GWIDTH-10, grd_curcanv->cv_font->ft_h ); |
| | | game_flush_inputs(); |
| | | |
| | | }//method kc_next_joyaxis |
| | | //end addition by WraithX |
| | | |
| | | |
| void kc_change_joyaxis( kc_item * item ) | | void kc_change_joyaxis( kc_item * item ) |
| { | | { |