riscos: Ensure that last_mouse_buttons is initialised correctly

This commit is contained in:
Cameron Cawley 2022-05-25 22:07:12 +01:00 committed by Sam Lantinga
parent cb43eb43f8
commit 347659e8cf
1 changed files with 4 additions and 0 deletions

View File

@ -143,6 +143,7 @@ int
RISCOS_InitEvents(_THIS)
{
SDL_VideoData *driverdata = (SDL_VideoData *) _this->driverdata;
_kernel_swi_regs regs;
int i, status;
for (i = 0; i < RISCOS_MAX_KEYS_PRESSED; i++)
@ -153,6 +154,9 @@ RISCOS_InitEvents(_THIS)
SDL_ToggleModState(KMOD_CAPS, (status & (1 << 4)) == 0);
SDL_ToggleModState(KMOD_SCROLL, (status & (1 << 1)) != 0);
_kernel_swi(OS_Mouse, &regs, &regs);
driverdata->last_mouse_buttons = regs.r[2];
/* Disable escape. */
_kernel_osbyte(229, 1, 0);