Browse Source

riscos: Ensure that last_mouse_buttons is initialised correctly

Cameron Cawley 2 năm trước cách đây
mục cha
commit
347659e8cf
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      src/video/riscos/SDL_riscosevents.c

+ 4 - 0
src/video/riscos/SDL_riscosevents.c

@@ -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);