예제 #1
0
        private void OnJoystickCallback(int jid, GLFW_Enum eventType)
        {
            if (eventType == GLFW_Enum.CONNECTED)
            {
                var name      = GLFW.GetJoystickName(jid);
                var isGamepad = GLFW.JoystickIsGamepad(jid) != 0;

                GLFW.GetJoystickButtons(jid, out int buttonCount);
                GLFW.GetJoystickAxes(jid, out int axisCount);

                OnJoystickConnect((uint)jid, name, (uint)buttonCount, (uint)axisCount, isGamepad);
            }
            else if (eventType == GLFW_Enum.DISCONNECTED)
            {
                OnJoystickDisconnect((uint)jid);
            }
        }