| version 1.10 | | version 1.11 |
|---|
| | |
| * Routines to configure keyboard, joystick, etc.. | | * Routines to configure keyboard, joystick, etc.. |
| * | | * |
| * $Log$ | | * $Log$ |
| | | * Revision 1.11 2000/11/30 10:34:48 donut |
| | | * make next axis config key skip currently allocated axes |
| | | * |
| * Revision 1.10 2000/11/30 10:13:38 donut | | * Revision 1.10 2000/11/30 10:13:38 donut |
| * joy configuration next axis key from WraithX | | * joy configuration next axis key from WraithX |
| * | | * |
| | |
| } | | } |
| | | |
| | | |
| //the following function added by WraithX on 11/22/00 to work around the weird joystick bug... | | //the following function added by WraithX on 11/22/00 to work around the weird joystick bug... - modified my Matt Mueller to skip already allocated axes |
| void kc_next_joyaxis( kc_item * item ) | | void kc_next_joyaxis( kc_item * item ) |
| { | | { |
| int n,i,k; | | int n,i,k,max,tries; |
| ubyte code = 0; | | ubyte code = 0; |
| k = 255; | | k = 255; |
| n = 0; | | n = 0; |
| | |
| //I modelled this ifdef after the code in the kc_change_joyaxis method. | | //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. | | //So, if somethin's not workin here, it might not be workin there either. |
| #ifdef __LINUX__ | | #ifdef __LINUX__ |
| code = (item->value + 1)%32; | | max = 32; |
| #else | | #else |
| code = (item->value + 1)%JOY_NUM_AXES; | | max = JOY_NUM_AXES; |
| #endif | | #endif |
| | | tries = 1; |
| | | code = (item->value + 1)%max; |
| | | |
| if (code!=255) { | | if (code!=255) { |
| for (i=0; i<Num_items; i++ ) { | | for (i=0; i<Num_items; i++ ) { |
| n = item - All_items; | | n = item - All_items; |
| if ( (i!=n) && (All_items[i].type==BT_JOY_AXIS) && (All_items[i].value==code) ) { | | if ( (i!=n) && (All_items[i].type==BT_JOY_AXIS) && (All_items[i].value==code) ) { |
| All_items[i].value = 255; | | if (tries>max) return; //all axes allocated already |
| kc_drawitem( &All_items[i], 0 ); | | i=-1; //-1 so the i++ will push back to 0 |
| | | code = (item->value + ++tries)%max; //try next axis |
| }//end if | | }//end if |
| }//end for | | }//end for |
| | | |