Add glfwGetJoystickHats

This merges the public part of the glfwGetJoystickHats work by
@IntellectualKitty.  The implementation needs replacing due to
refactoring in preparation for gamecontrollerdb support.

Closes #906.
This commit is contained in:
IntellectualKitty
2016-11-25 20:56:24 -07:00
committed by Camilla Löwy
parent 12dcfd08b8
commit 368dec7ac7
3 changed files with 92 additions and 3 deletions

View File

@@ -463,17 +463,19 @@ static void joystick_callback(int jid, int event)
{
if (event == GLFW_CONNECTED)
{
int axisCount, buttonCount;
int axisCount, buttonCount, hatCount;
glfwGetJoystickAxes(jid, &axisCount);
glfwGetJoystickButtons(jid, &buttonCount);
glfwGetJoystickHats(jid, &hatCount);
printf("%08x at %0.3f: Joystick %i (%s) was connected with %i axes and %i buttons\n",
printf("%08x at %0.3f: Joystick %i (%s) was connected with %i axes, %i buttons, and %i hats\n",
counter++, glfwGetTime(),
jid,
glfwGetJoystickName(jid),
axisCount,
buttonCount);
buttonCount,
hatCount);
}
else
{