소스 검색

The hat index passed to the application should be zero-based with no holes

Sam Lantinga 6 년 전
부모
커밋
3fbaa5da05
1개의 변경된 파일2개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 3
      src/joystick/linux/SDL_sysjoystick.c

+ 2 - 3
src/joystick/linux/SDL_sysjoystick.c

@@ -773,9 +773,8 @@ HandleHat(SDL_Joystick * stick, Uint8 hat, int axis, int value)
     }
     if (value != the_hat->axis[axis]) {
         the_hat->axis[axis] = value;
-        SDL_PrivateJoystickHat(stick, hat,
-                               position_map[the_hat->
-                                            axis[1]][the_hat->axis[0]]);
+        SDL_PrivateJoystickHat(stick, stick->hwdata->hats_indices[hat],
+                               position_map[the_hat->axis[1]][the_hat->axis[0]]);
     }
 }