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.

24 lines
451B

  1. #include "gamepad.hpp"
  2. #include "util/common.hpp"
  3. #include <GLFW/glfw3.h>
  4. namespace rack {
  5. void gamepadStep() {
  6. for (int i = 0; i < 16; i++) {
  7. if (glfwJoystickPresent(i)) {
  8. const char *name = glfwGetJoystickName(i);
  9. int numButtons;
  10. const unsigned char *buttons = glfwGetJoystickButtons(i, &numButtons);
  11. int numAxes;
  12. const float *axes = glfwGetJoystickAxes(i, &numAxes);
  13. debug("%d %s", i, name);
  14. }
  15. }
  16. }
  17. } // namespace rack