make use of mouse buttons

This commit is contained in:
fgsfds 2020-05-10 18:41:46 +03:00
parent 32ec185188
commit e427aaa894
1 changed files with 5 additions and 1 deletions

View File

@ -51,7 +51,11 @@ static void controller_sdl_read(OSContPad *pad) {
else
SDL_SetRelativeMouseMode(SDL_FALSE);
SDL_GetRelativeMouseState(&mouse_x, &mouse_y);
const u32 mbuttons = SDL_GetRelativeMouseState(&mouse_x, &mouse_y);
if (mbuttons & SDL_BUTTON_LMASK) pad->button |= B_BUTTON;
if (mbuttons & SDL_BUTTON_RMASK) pad->button |= A_BUTTON;
if (mbuttons & SDL_BUTTON_MMASK) pad->button |= Z_TRIG;
#endif
SDL_GameControllerUpdate();