Open Marzac opened 6 years ago
I made a stub class as I don't want to see #ifdefs (for platform specifics) in examples code.
Another inspiration could be: https://github.com/glfw/glfw/blob/master/src/cocoa_joystick.m
I think there is no chance to implement this without including some Objective-C classes and do some specific Apple MacOS programming. This is nothing I want / will do, therefore help would be appreciated!
One of the most and only missing feature from the MacOS port is the gamepad support. At the moment, gamepads (XBOX 360 USB and lookalike) are supported on both Windows and Unix OS.
The support is done with some very native code, with XInput for Win and evdev for Linux. It provides gamepads enumeration, scanning of joysticks and buttons and support of rumble (force feedback) in a platform independent way.
The gamepad class should be written for MacOS and I have yet no idea where to start.
I have had a look at the SFML code: https://github.com/SFML/SFML/blob/master/src/SFML/Window/OSX/JoystickImpl.cpp https://github.com/SFML/SFML/blob/master/src/SFML/Window/OSX/HIDInputManager.mm
But I must admit I don't understand much what is happening there.