Add X1 and X2 button support to mouse test

This commit is contained in:
IOBYTE 2022-03-04 10:47:25 -05:00 committed by Ethan Lee
parent 2f7b885df9
commit 13756b5c72
1 changed files with 4 additions and 0 deletions

View File

@ -100,6 +100,8 @@ loop(void *arg)
case SDL_BUTTON_LEFT: active->r = 255; buttons |= SDL_BUTTON_LMASK; break; case SDL_BUTTON_LEFT: active->r = 255; buttons |= SDL_BUTTON_LMASK; break;
case SDL_BUTTON_MIDDLE: active->g = 255; buttons |= SDL_BUTTON_MMASK; break; case SDL_BUTTON_MIDDLE: active->g = 255; buttons |= SDL_BUTTON_MMASK; break;
case SDL_BUTTON_RIGHT: active->b = 255; buttons |= SDL_BUTTON_RMASK; break; case SDL_BUTTON_RIGHT: active->b = 255; buttons |= SDL_BUTTON_RMASK; break;
case SDL_BUTTON_X1: active->r = 255; active->b = 255; buttons |= SDL_BUTTON_X1MASK; break;
case SDL_BUTTON_X2: active->g = 255; active->b = 255; buttons |= SDL_BUTTON_X2MASK; break;
} }
break; break;
case SDL_MOUSEBUTTONUP: case SDL_MOUSEBUTTONUP:
@ -110,6 +112,8 @@ loop(void *arg)
case SDL_BUTTON_LEFT: buttons &= ~SDL_BUTTON_LMASK; break; case SDL_BUTTON_LEFT: buttons &= ~SDL_BUTTON_LMASK; break;
case SDL_BUTTON_MIDDLE: buttons &= ~SDL_BUTTON_MMASK; break; case SDL_BUTTON_MIDDLE: buttons &= ~SDL_BUTTON_MMASK; break;
case SDL_BUTTON_RIGHT: buttons &= ~SDL_BUTTON_RMASK; break; case SDL_BUTTON_RIGHT: buttons &= ~SDL_BUTTON_RMASK; break;
case SDL_BUTTON_X1: buttons &= ~SDL_BUTTON_X1MASK; break;
case SDL_BUTTON_X2: buttons &= ~SDL_BUTTON_X2MASK; break;
} }
if (buttons == 0) { if (buttons == 0) {