PistonDevelopers / piston-examples

A collection of examples using the Piston game engine
MIT License
342 stars 90 forks source link

Testing joystick with "user_input" example #310

Open bvssvni opened 9 years ago

bvssvni commented 9 years ago

Editing the "user_input" example to test joystick events with the SDL2 window backend. I'm using a PS3 controller connected to a mac.

Here is the input button mapping:

PS3 controlller

bvssvni commented 9 years ago

Joystick axis is a bit harder to read. Could draw the input visually.

xaviershay commented 9 years ago

you beat me to it! :)

bvssvni commented 9 years ago

I was trying to connect via Bluetooth and Firefox crashed. Wat.

bvssvni commented 9 years ago

PS3 controller via Bluetooth works now. Here is what I did on OSX 10.9.5:

  1. Enable Bluetooth in Systems Preferences.
  2. Connect the PS3 controller via USB.
  3. Click at the Bluetooth icon in the top bar, select the MAC address (I had to guess) and then -> Connect.
  4. Disconnect the USB cable.
  5. Hold the button with PlayStation logo down for 1-2 seconds.
  6. Start the "user_input" example.
bvssvni commented 9 years ago

I have a PlayStation Move controller as well, but it doesn't work yet.

ffigiel commented 6 years ago

The user_input example doesn't see my xbox360 controller input at all. What can I do? I'm on Windows 10

cedric-h commented 6 years ago

Exact same situation as @megapctr... is it because glutin doesn't suppoort gamepad input? Would an SDL2 backend work?

cedric-h commented 6 years ago

https://github.com/Arvamer/gilrs

This lib works quite well for me, do keep in mind however that it doesn't have Mac support.