💿🐜 Antkeeper source code https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
2.4 KiB

  1. /*
  2. * Copyright (C) 2021 Christopher J. Howard
  3. *
  4. * This file is part of Antkeeper source code.
  5. *
  6. * Antkeeper source code is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * Antkeeper source code is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with Antkeeper source code. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #include "sdl-game-controller-tables.hpp"
  20. #include "game-controller.hpp"
  21. namespace input {
  22. const game_controller_button sdl_button_table[15] =
  23. {
  24. game_controller_button::a, // SDL_CONTROLLER_BUTTON_A,
  25. game_controller_button::b, // SDL_CONTROLLER_BUTTON_B,
  26. game_controller_button::x, // SDL_CONTROLLER_BUTTON_X,
  27. game_controller_button::y, // SDL_CONTROLLER_BUTTON_Y,
  28. game_controller_button::back, // SDL_CONTROLLER_BUTTON_BACK,
  29. game_controller_button::guide, // SDL_CONTROLLER_BUTTON_GUIDE,
  30. game_controller_button::start, // SDL_CONTROLLER_BUTTON_START,
  31. game_controller_button::left_stick, // SDL_CONTROLLER_BUTTON_LEFTSTICK,
  32. game_controller_button::right_stick, // SDL_CONTROLLER_BUTTON_RIGHTSTICK,
  33. game_controller_button::left_shoulder, // SDL_CONTROLLER_BUTTON_LEFTSHOULDER,
  34. game_controller_button::right_shoulder, // SDL_CONTROLLER_BUTTON_RIGHTSHOULDER,
  35. game_controller_button::dpad_up, // SDL_CONTROLLER_BUTTON_DPAD_UP,
  36. game_controller_button::dpad_down, // SDL_CONTROLLER_BUTTON_DPAD_DOWN,
  37. game_controller_button::dpad_left, // SDL_CONTROLLER_BUTTON_DPAD_LEFT,
  38. game_controller_button::dpad_right, // SDL_CONTROLLER_BUTTON_DPAD_RIGHT,
  39. };
  40. const game_controller_axis sdl_axis_table[6] =
  41. {
  42. game_controller_axis::left_x, // SDL_CONTROLLER_AXIS_LEFTX,
  43. game_controller_axis::left_y, // SDL_CONTROLLER_AXIS_LEFTY,
  44. game_controller_axis::right_x, // SDL_CONTROLLER_AXIS_RIGHTX,
  45. game_controller_axis::right_y, // SDL_CONTROLLER_AXIS_RIGHTY,
  46. game_controller_axis::trigger_left, // SDL_CONTROLLER_AXIS_TRIGGERLEFT,
  47. game_controller_axis::trigger_right, // SDL_CONTROLLER_AXIS_TRIGGERRIGHT,
  48. };
  49. } // namespace input