}
#pragma GCC diagnostic pop
+static int vg_console_enabled(void);
+
static inline int vg_get_button( const char *button )
{
- return vg_get_button_ptr( button )->value;
+ return vg_get_button_ptr( button )->value && !vg_console_enabled();
}
static inline int vg_get_button_down( const char *button )
{
struct button_binding *bind = vg_get_button_ptr( button );
- return bind->value & (bind->value ^ bind->prev);
+ return bind->value & (bind->value ^ bind->prev) && !vg_console_enabled();
}
static inline int vg_get_button_up( const char *button )
{
struct button_binding *bind = vg_get_button_ptr( button );
- return bind->prev & (bind->value ^ bind->prev);
+ return bind->prev & (bind->value ^ bind->prev) && !vg_console_enabled();
+}
+
+static inline int vg_get_button_state( const char *button )
+{
+ if( vg_get_button_down( button ) ) return 1;
+ if( vg_get_button_up( button ) ) return 3;
+ if( vg_get_button( button ) ) return 2;
+ return 0;
}
static inline int key_is_keyboard( int const id )