src/joystick/linux/SDL_sysjoystick.c
changeset 2735 204be4fc2726
parent 2713 0906692aa6a4
child 2859 99210400e8b9
     1.1 --- a/src/joystick/linux/SDL_sysjoystick.c	Wed Aug 27 13:37:19 2008 +0000
     1.2 +++ b/src/joystick/linux/SDL_sysjoystick.c	Wed Aug 27 15:10:03 2008 +0000
     1.3 @@ -89,6 +89,7 @@
     1.4  static struct joystick_logical_mapping mp88xx_1_logical_axismap[] = {
     1.5      {0, 0}, {0, 1}, {0, 2}, {0, 3}, {0, 4}, {0, 5}
     1.6  };
     1.7 +
     1.8  static struct joystick_logical_mapping mp88xx_1_logical_buttonmap[] = {
     1.9      {0, 0}, {0, 1}, {0, 2}, {0, 3}, {0, 4}, {0, 5}, {0, 6}, {0, 7}, {0, 8},
    1.10      {0, 9}, {0, 10}, {0, 11}
    1.11 @@ -98,6 +99,7 @@
    1.12      {0, 0}, {0, 1}, {0, 2}, {1, 0}, {1, 1}, {0, 3},
    1.13      {1, 2}, {1, 3}, {0, 4}, {0, 5}, {1, 4}, {1, 5}
    1.14  };
    1.15 +
    1.16  static struct joystick_logical_mapping mp88xx_2_logical_buttonmap[] = {
    1.17      {0, 0}, {0, 1}, {0, 2}, {0, 3}, {0, 4}, {0, 5}, {0, 6}, {0, 7}, {0, 8},
    1.18      {0, 9}, {0, 10}, {0, 11},
    1.19 @@ -110,6 +112,7 @@
    1.20      {1, 2}, {1, 3}, {2, 0}, {2, 1}, {2, 2}, {2, 3},
    1.21      {0, 4}, {0, 5}, {1, 4}, {1, 5}, {2, 4}, {2, 5}
    1.22  };
    1.23 +
    1.24  static struct joystick_logical_mapping mp88xx_3_logical_buttonmap[] = {
    1.25      {0, 0}, {0, 1}, {0, 2}, {0, 3}, {0, 4}, {0, 5}, {0, 6}, {0, 7}, {0, 8},
    1.26      {0, 9}, {0, 10}, {0, 11},
    1.27 @@ -125,6 +128,7 @@
    1.28      {3, 0}, {3, 1}, {3, 2}, {3, 3}, {0, 4}, {0, 5},
    1.29      {1, 4}, {1, 5}, {2, 4}, {2, 5}, {3, 4}, {3, 5}
    1.30  };
    1.31 +
    1.32  static struct joystick_logical_mapping mp88xx_4_logical_buttonmap[] = {
    1.33      {0, 0}, {0, 1}, {0, 2}, {0, 3}, {0, 4}, {0, 5}, {0, 6}, {0, 7}, {0, 8},
    1.34      {0, 9}, {0, 10}, {0, 11},
    1.35 @@ -147,15 +151,18 @@
    1.36  static struct joystick_logical_layout mp88xx_1_logical_layout[] = {
    1.37      {6, 0, 0, 12}
    1.38  };
    1.39 +
    1.40  static struct joystick_logical_layout mp88xx_2_logical_layout[] = {
    1.41      {6, 0, 0, 12},
    1.42      {6, 0, 0, 12}
    1.43  };
    1.44 +
    1.45  static struct joystick_logical_layout mp88xx_3_logical_layout[] = {
    1.46      {6, 0, 0, 12},
    1.47      {6, 0, 0, 12},
    1.48      {6, 0, 0, 12}
    1.49  };
    1.50 +
    1.51  static struct joystick_logical_layout mp88xx_4_logical_layout[] = {
    1.52      {6, 0, 0, 12},
    1.53      {6, 0, 0, 12},
    1.54 @@ -953,8 +960,8 @@
    1.55  #endif /* USE_LOGICAL_JOYSTICKS */
    1.56  
    1.57          SDL_PrivateJoystickHat(stick, hat,
    1.58 -                               position_map[the_hat->axis[1]][the_hat->
    1.59 -                                                              axis[0]]);
    1.60 +                               position_map[the_hat->
    1.61 +                                            axis[1]][the_hat->axis[0]]);
    1.62      }
    1.63  }
    1.64  
    1.65 @@ -1085,13 +1092,13 @@
    1.66                      code -= BTN_MISC;
    1.67  #ifndef NO_LOGICAL_JOYSTICKS
    1.68                      if (!LogicalJoystickButton(joystick,
    1.69 -                                               joystick->hwdata->
    1.70 -                                               key_map[code],
    1.71 +                                               joystick->
    1.72 +                                               hwdata->key_map[code],
    1.73                                                 events[i].value))
    1.74  #endif
    1.75                          SDL_PrivateJoystickButton(joystick,
    1.76 -                                                  joystick->hwdata->
    1.77 -                                                  key_map[code],
    1.78 +                                                  joystick->
    1.79 +                                                  hwdata->key_map[code],
    1.80                                                    events[i].value);
    1.81                  }
    1.82                  break;
    1.83 @@ -1113,12 +1120,12 @@
    1.84                          EV_AxisCorrect(joystick, code, events[i].value);
    1.85  #ifndef NO_LOGICAL_JOYSTICKS
    1.86                      if (!LogicalJoystickAxis(joystick,
    1.87 -                                             joystick->hwdata->
    1.88 -                                             abs_map[code], events[i].value))
    1.89 +                                             joystick->hwdata->abs_map[code],
    1.90 +                                             events[i].value))
    1.91  #endif
    1.92                          SDL_PrivateJoystickAxis(joystick,
    1.93 -                                                joystick->hwdata->
    1.94 -                                                abs_map[code],
    1.95 +                                                joystick->
    1.96 +                                                hwdata->abs_map[code],
    1.97                                                  events[i].value);
    1.98                      break;
    1.99                  }