12345678910111213141516 |
- #include "client/input/Controller.h"
- Controller::Controller(Buttons& b) : list(b.get()), left(b.add(GLFW_KEY_A, "Left")), right(b.add(GLFW_KEY_D, "Right")),
- up(b.add(GLFW_KEY_W, "X")), down(b.add(GLFW_KEY_S, "Y")), jump(b.add(GLFW_KEY_SPACE, "L")),
- sneak(b.add(GLFW_KEY_LEFT_SHIFT, "R")), camLeft(b.add(GLFW_KEY_LEFT, "Start")),
- camRight(b.add(GLFW_KEY_RIGHT, "Select")), camUp(b.add(GLFW_KEY_UP, "Left")), camDown(b.add(GLFW_KEY_DOWN, "Right")) {
- b.mapGamepadAxis(left, -0.5f, GLFW_GAMEPAD_AXIS_LEFT_X);
- b.mapGamepadAxis(right, 0.5f, GLFW_GAMEPAD_AXIS_LEFT_X);
- b.mapGamepadAxis(up, -0.5f, GLFW_GAMEPAD_AXIS_LEFT_Y);
- b.mapGamepadAxis(down, 0.5f, GLFW_GAMEPAD_AXIS_LEFT_Y);
-
- b.mapGamepadAxis(camUp, -0.5f, GLFW_GAMEPAD_AXIS_RIGHT_Y);
- b.mapGamepadAxis(camDown, 0.5f, GLFW_GAMEPAD_AXIS_RIGHT_Y);
- b.mapGamepadAxis(camLeft, -0.5f, GLFW_GAMEPAD_AXIS_RIGHT_X);
- b.mapGamepadAxis(camRight, 0.5f, GLFW_GAMEPAD_AXIS_RIGHT_X);
- }
|