Browse Source

Fix hat mapping if dpad emulation is deactivated

fireclawthefox 9 years ago
parent
commit
2da890800f
1 changed files with 4 additions and 0 deletions
  1. 4 0
      panda/src/device/evdevInputDevice.cxx

+ 4 - 0
panda/src/device/evdevInputDevice.cxx

@@ -386,6 +386,10 @@ init_device() {
             _dpad_up_button = (int)_buttons.size();
             _dpad_up_button = (int)_buttons.size();
             _buttons.push_back(ButtonState(GamepadButton::dpad_up()));
             _buttons.push_back(ButtonState(GamepadButton::dpad_up()));
             _buttons.push_back(ButtonState(GamepadButton::dpad_down()));
             _buttons.push_back(ButtonState(GamepadButton::dpad_down()));
+          } else if (i == ABS_HAT0X) {
+            set_control_map(i, C_hat_x);
+          } else if (i == ABS_HAT0Y) {
+            set_control_map(i, C_hat_y);
           }
           }
         } else {
         } else {
           set_control_map(i, axis_map[i]);
           set_control_map(i, axis_map[i]);