21 #include <SDL2/SDL_mouse.h>
22 #include <SDL2/SDL_keyboard.h>
29 uint32_t buttons = SDL_GetMouseState(x, y);
51 return SDL_GetMouseState(
nullptr,
nullptr);
63 unsigned mods = SDL_GetModState();
66 mods &= KMOD_SHIFT | KMOD_CTRL | KMOD_ALT | KMOD_GUI;
69 if(mods & KMOD_SHIFT) {
73 if(mods & KMOD_CTRL) {
uint32_t get_mouse_button_mask()
Returns the current mouse button mask.
uint32_t get_mouse_state(int *x, int *y)
A wrapper for SDL_GetMouseState that gives coordinates in draw space.
unsigned get_mods()
Returns a bitmask of active modifier keys (ctrl, shift, alt, gui).
point get_mouse_location()
Returns the current mouse location in draw space.
bool headless()
The game is running headless.
point game_canvas_size()
The size of the game canvas, in drawing coordinates / game pixels.
rect input_area()
Returns the input area of the window, in display coordinates.
An abstract description of a rectangle with integer coordinates.