21 #include <SDL3/SDL_mouse.h>
22 #include <SDL3/SDL_keyboard.h>
29 uint32_t buttons = SDL_GetMouseState(x, y);
51 return SDL_GetMouseState(
nullptr,
nullptr);
59 return {
static_cast<int>(x),
static_cast<int>(y)};
64 unsigned mods = SDL_GetModState();
67 mods &= SDL_KMOD_SHIFT | SDL_KMOD_CTRL | SDL_KMOD_ALT | SDL_KMOD_GUI;
70 if(mods & SDL_KMOD_SHIFT) {
71 mods |= SDL_KMOD_SHIFT;
74 if(mods & SDL_KMOD_CTRL) {
75 mods |= SDL_KMOD_CTRL;
78 if(mods & SDL_KMOD_ALT)
81 if(mods & SDL_KMOD_GUI) {
uint32_t get_mouse_button_mask()
Returns the current mouse button mask.
uint32_t get_mouse_state(float *x, float *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.