mirror of
https://github.com/glfw/glfw.git
synced 2026-01-11 15:23:17 +01:00
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:
committed by
Camilla Löwy
parent
12dcfd08b8
commit
368dec7ac7
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user