86 #include "render/graphics.h"
89 PRAGMA48(GCC diagnostic ignored
"-Wshadow")
90 #include <SDL_timer.h>
96 bool keyboardClosed =
false;
144 bool visible = SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE;
147 keyboardClosed =
false;
149 else if (!keyboardClosed)
152 keyboardClosed =
true;
178 keyInput.setText(event.text.text);
184 const int y =
event.wheel.y;
208 case SDL_ACCELEROMETER:
213 case SDL_MOUSEBUTTONDOWN:
217 const int x =
event.button.x / scale;
218 const int y =
event.button.y / scale;
226 mouseInput.
setReal(event.button.realx / scale,
227 event.button.realy / scale);
234 if (event.button.button == SDL_BUTTON_WHEELDOWN)
236 else if (event.button.button == SDL_BUTTON_WHEELUP)
245 case SDL_MOUSEBUTTONUP:
249 const int x =
event.button.x / scale;
250 const int y =
event.button.y / scale;
258 mouseInput.
setReal(event.button.realx / scale,
259 event.button.realy / scale);
269 case SDL_MOUSEMOTION:
272 const int x =
event.motion.x / scale;
273 const int y =
event.motion.y / scale;
281 mouseInput.
setReal(event.motion.realx / scale,
282 event.motion.realy / scale);
294 case SDL_ACTIVEEVENT:
299 if ((event.active.state & SDL_APPMOUSEFOCUS) != 0 &&
300 event.active.gain == 0U)
315 if ((event.active.state & SDL_APPMOUSEFOCUS) != 0 &&
316 event.active.gain != 0U)
341 case SDL_BUTTON_LEFT:
343 case SDL_BUTTON_RIGHT:
345 case SDL_BUTTON_MIDDLE:
348 case SDL_BUTTON_WHEELUP:
349 case SDL_BUTTON_WHEELDOWN:
355 logger->
log(
"unknown button type: %d", button);
414 keyInput.setText(str);
static uint8_t getMouseState(int &x, int &y)
int getLastMouseX() const
int getLastMouseY() const
void log(const char *const log_text,...)
#define BLOCK_START(name)