Re: [AD] Ouya controller support

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


The gamepad sends key and motion events. Which controller the event came from is determined with OuyaController.getPlayerNumByDeviceId(event.getDeviceId()).

I have been experimenting with a joystick driver that is based on the key and motion event and it works fine. The idea with my current implementation is to emulate the button and stick layout as they appear when paired to a computer and running the ex_joystick_event example so that the game can be tested on a computer.

The feture is currently enabled by passing WANT_OUYA to CMake but it should be easy to detect at runtime if the OuyaController class is available and then replace the accelerometer.

I am planning to try enabling the Linux joystick driver too. Maybe it just works since Android is Linux.

The current code can be found here: https://github.com/lilliemarck/allegro in branch 5.1-ouya_controller. It still only emulates a single controller.



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/