Browse Source

Fixed mapping third party XBox controllers that have the trigger axis all the way in until they are pulled and get updated values.

Sam Lantinga 10 năm trước cách đây
mục cha
commit
7b680a2ab7
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      test/controllermap.c

+ 1 - 1
test/controllermap.c

@@ -232,7 +232,7 @@ WatchJoystick(SDL_Joystick * joystick)
             if (SDL_PollEvent(&event)) {
             if (SDL_PollEvent(&event)) {
                 switch (event.type) {
                 switch (event.type) {
                 case SDL_JOYAXISMOTION:
                 case SDL_JOYAXISMOTION:
-                    if (event.jaxis.value > 20000 || event.jaxis.value < -20000) {
+                    if ((event.jaxis.value > 20000 || event.jaxis.value < -20000) && event.jaxis.value != -32768) {
                         for (_s = 0; _s < s; _s++) {
                         for (_s = 0; _s < s; _s++) {
                             if (steps[_s].axis == event.jaxis.axis) {
                             if (steps[_s].axis == event.jaxis.axis) {
                                 break;
                                 break;