diff options
Diffstat (limited to 'mkb')
-rw-r--r-- | mkb/mkb.c | 14 | ||||
-rw-r--r-- | mkb/mkb.h | 6 |
2 files changed, 10 insertions, 10 deletions
@@ -1,17 +1,17 @@ -#include <mkb.h> +#include "mkb.h" -bool mkb_search(MKb *mkb, SDL_Scancode scancode) { +int mkb_search(MKb *mkb, SDL_Scancode scancode) { for (int i=0; i<mkb->kbnum; i++) { if (mkb->kb[i] == scancode) - return true; + return 1; } - return false; + return 0; } -bool mkb_statesearch (MKb *mkb, SDL_Scancode scancode) { +int mkb_statesearch (MKb *mkb, SDL_Scancode scancode) { const Uint8 *state = SDL_GetKeyboardState(NULL); - if (state[scancode]) return true; - return false; + if (state[scancode]) return 1; + return 0; } void mkb_init(MKb *mkb) { @@ -1,7 +1,7 @@ #ifndef MKB_H #define MKB_H -#include <SDL.h> +#include <SDL2/SDL.h> // SDL2 mouse and keyboard @@ -16,8 +16,8 @@ typedef struct { } MKb; void mkb_init(MKb *mkb); -bool mkb_search(MKb *mkb, SDL_Scancode scancode); -bool mkb_statesearch(MKb *mkb, SDL_Scancode scancode); +int mkb_search(MKb *mkb, SDL_Scancode scancode); +int mkb_statesearch(MKb *mkb, SDL_Scancode scancode); void mkb_event(MKb *mkb, SDL_Event *e); void mkb_process(MKb *mkb); |