[k_srbind_replay_play]= controller_glyph( SDL_CONTROLLER_BUTTON_X ),
[k_srbind_replay_freecam]=controller_glyph(SDL_CONTROLLER_BUTTON_Y ),
[k_srbind_replay_resume]=controller_glyph( SDL_CONTROLLER_BUTTON_A ),
[k_srbind_replay_play]= controller_glyph( SDL_CONTROLLER_BUTTON_X ),
[k_srbind_replay_freecam]=controller_glyph(SDL_CONTROLLER_BUTTON_Y ),
[k_srbind_replay_resume]=controller_glyph( SDL_CONTROLLER_BUTTON_A ),
[k_srbind_replay_play]= KEYBOARD_GLYPH( "G" ),
[k_srbind_replay_freecam] = KEYBOARD_GLYPH( "F" ),
[k_srbind_replay_resume]= "\xa1",
[k_srbind_replay_play]= KEYBOARD_GLYPH( "G" ),
[k_srbind_replay_freecam] = KEYBOARD_GLYPH( "F" ),
[k_srbind_replay_resume]= "\xa1",
- [k_srbind_sit] = KEYBOARD_GLYPH( "Z" )
+ [k_srbind_sit] = KEYBOARD_GLYPH( "Z" ),
+ [k_srbind_lobby] = KEYBOARD_GLYPH( "" ), // FIXME: what is tab?
+ [k_srbind_chat] = KEYBOARD_GLYPH( "Y" )
-static int buttons_filter_fixed(void)
-{
- if( !srinput.enabled ) return 1;
- if( vg_ui.wants_mouse ) return 1;
+static int input_filter_generic(void){
+ if( !srinput.enabled || vg_ui.wants_mouse || vg_console.enabled )
+ return 1;
+ else
+ return 0;
+}
+
+static int buttons_filter_fixed(void){
+ if( input_filter_generic() )
+ return 1;
-static int button_press( enum sr_bind button )
-{
- if( vg_ui.wants_mouse ) return 0;
- return srinput.button_states[ button ][0];
+static int button_press( enum sr_bind button ){
+ if( input_filter_generic() )
+ return 0;
+ return
+ srinput.button_states[ button ][0];
-static void joystick_state( enum sr_joystick joystick, v2f state )
-{
- if( vg_ui.wants_mouse )
+static void joystick_state( enum sr_joystick joystick, v2f state ){
+ if( input_filter_generic() )
v2_zero( state );
else
v2_copy( srinput.joystick_states[ joystick ][0], state );
}
static float axis_state( enum sr_axis axis ){
v2_zero( state );
else
v2_copy( srinput.joystick_states[ joystick ][0], state );
}
static float axis_state( enum sr_axis axis ){
setbtn( k_srbind_replay_freecam, vg_getkey(SDLK_f) );
setbtn( k_srbind_replay_resume, vg_getkey(SDLK_SPACE) );
setbtn( k_srbind_sit, vg_getkey(SDLK_z) );
setbtn( k_srbind_replay_freecam, vg_getkey(SDLK_f) );
setbtn( k_srbind_replay_resume, vg_getkey(SDLK_SPACE) );
setbtn( k_srbind_sit, vg_getkey(SDLK_z) );
setbtn( k_srbind_replay_play, buttons[ SDL_CONTROLLER_BUTTON_X ] );
setbtn( k_srbind_replay_freecam, buttons[ SDL_CONTROLLER_BUTTON_Y ] );
setbtn( k_srbind_sit, buttons[ SDL_CONTROLLER_BUTTON_B ] );
setbtn( k_srbind_replay_play, buttons[ SDL_CONTROLLER_BUTTON_X ] );
setbtn( k_srbind_replay_freecam, buttons[ SDL_CONTROLLER_BUTTON_Y ] );
setbtn( k_srbind_sit, buttons[ SDL_CONTROLLER_BUTTON_B ] );
float *axis = controller->axises;
float *steer = srinput.joystick_states[ k_srjoystick_steer ][0],
float *axis = controller->axises;
float *steer = srinput.joystick_states[ k_srjoystick_steer ][0],