Fixed mapping third party XBox controllers that have the trigger axis all the way in until they are pulled and get updated values.
authorSam Lantinga <slouken@libsdl.org>
Fri, 18 Dec 2015 18:49:23 -0800
changeset 996273a2ce1cdc02
parent 9961 a66dd6fd112c
child 9963 8da3e4d25202
Fixed mapping third party XBox controllers that have the trigger axis all the way in until they are pulled and get updated values.
test/controllermap.c
     1.1 --- a/test/controllermap.c	Fri Dec 18 00:49:27 2015 -0400
     1.2 +++ b/test/controllermap.c	Fri Dec 18 18:49:23 2015 -0800
     1.3 @@ -232,7 +232,7 @@
     1.4              if (SDL_PollEvent(&event)) {
     1.5                  switch (event.type) {
     1.6                  case SDL_JOYAXISMOTION:
     1.7 -                    if (event.jaxis.value > 20000 || event.jaxis.value < -20000) {
     1.8 +                    if ((event.jaxis.value > 20000 || event.jaxis.value < -20000) && event.jaxis.value != -32768) {
     1.9                          for (_s = 0; _s < s; _s++) {
    1.10                              if (steps[_s].axis == event.jaxis.axis) {
    1.11                                  break;