test/controllermap.c
changeset 10726 893faaa67394
parent 10724 5ea5f198879f
child 10729 9059ffccccb2
equal deleted inserted replaced
10725:fa8ffe60cf4f 10726:893faaa67394
   411                     nCurrentDistance = SDL_abs(nValue - pAxisState->m_nStartingValue);
   411                     nCurrentDistance = SDL_abs(nValue - pAxisState->m_nStartingValue);
   412                     nFarthestDistance = SDL_abs(pAxisState->m_nFarthestValue - pAxisState->m_nStartingValue);
   412                     nFarthestDistance = SDL_abs(pAxisState->m_nFarthestValue - pAxisState->m_nStartingValue);
   413                     if (nCurrentDistance > nFarthestDistance) {
   413                     if (nCurrentDistance > nFarthestDistance) {
   414                         pAxisState->m_nFarthestValue = nValue;
   414                         pAxisState->m_nFarthestValue = nValue;
   415                     }
   415                     }
   416                     if (nCurrentDistance < 10000 && nFarthestDistance > 20000) {
   416                     if (nCurrentDistance <= 8000 && nFarthestDistance >= 20000) {
   417                         /* We've gone out and back, let's bind this axis */
   417                         /* We've gone out and back, let's bind this axis */
   418                         SDL_GameControllerExtendedBind binding;
   418                         SDL_GameControllerExtendedBind binding;
   419                         SDL_zero(binding);
   419                         SDL_zero(binding);
   420                         binding.bindType = SDL_CONTROLLER_BINDTYPE_AXIS;
   420                         binding.bindType = SDL_CONTROLLER_BINDTYPE_AXIS;
   421                         binding.value.axis.axis = event.jaxis.axis;
   421                         binding.value.axis.axis = event.jaxis.axis;