projects
/
fishladder.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
save file .sv2 format read/write
[fishladder.git]
/
vg
/
vg_input.h
diff --git
a/vg/vg_input.h
b/vg/vg_input.h
index 62dd4b15b39f381737d9a4f03f42da746541fd0f..6bae274d99cff79a25e39c220a6742463578eb60 100644
(file)
--- a/
vg/vg_input.h
+++ b/
vg/vg_input.h
@@
-89,6
+89,14
@@
static inline int vg_get_button_up( const char *button )
return bind->prev & (bind->value ^ bind->prev) && !vg_console_enabled();
}
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 )
{
vg_static_assert( GLFW_MOUSE_BUTTON_LAST < GLFW_KEY_SPACE, "GLFW: Mouse has too many buttons" );
static inline int key_is_keyboard( int const id )
{
vg_static_assert( GLFW_MOUSE_BUTTON_LAST < GLFW_KEY_SPACE, "GLFW: Mouse has too many buttons" );