why not just add chip to the input group in /etc/group?
I downloaded the file @computermouth posted aboive and put it in the location, plugged in the xbone controller, dmesg showed the device as a microsoft controller, but its not working in pico-8. of course I am using the onboard usb port as I dont have a powered USB hub(yet), but the controller just flashes a few times then powers off(as opposed to the light staying on when plugged into my pc). pico log shows zero controllers…
I may try the ps3 bt controller in a bit, but I have some other stuff I want to try out first.
I’ve been searching all over for an answer to why SDL was not detecting my iBuffalo controller. Just like @chrisjaure mentioned, SDL uses /dev/input/event* for gamepad input capture. However, my user (chip) did not have permission to access these, so it was failing silently.
As @Coded mentioned, to grant the chip user access, add the chip user to the input group.
sudo nano /etc/group
Arrow down to the line that says:
Type control+x, to exit. It will prompt you to save the file. Type y, then return to save the file and quit the nano text editor. Restart your PocketCHIP and SDL will now be able to read the gamepad input.
So, I was asking this same question over at the Pico-8 forums and a very nice fellow was helping me out… I did everything he said, but still couldn’t get it to work. When you replied I figured I’d wait until I got the same controller as you to try, but today I thought ‘what the heck…’ and tried using what I got. To my surprise, it actually worked! Well, sort of… both the “A” & “B” buttons do the same thing… they both seem to control the “X” button in Pico-8, and so I have no control for the “Z” button. Is this what you are experiencing with your other controller? I may still buy that same Buffalo controller that you got to work…
This is what I entered into the controller.txt… The nice fellow from the Pico-8 forums helped figure it out since there wasn’t one existing for my controller, and the sdl gamepad thing wasn’t ready yet for Linux:
Ahh, yes, I’m experiencing something similar! Basically everything on the NES controller I have works except the B button, which does nothing.
I’ll have to try that SDL config when I get the chance. I’d really just like step-by-step instructions on how to generate them. I’ve seen an app that works on Mac and Windows, but there’s no Linux version yet. If anyone has some step-by-step instructions on how to do it on command line, please share! Otherwise I may open a separate thread on the PICO-8 forums or something.
Been reading this and following the instructions. I’m stuck at the point of renaming the file to sdl_controllers.txt because my pocketCHIP can not do the underscore ( _ ) character. Pressing SHIFT+_ (the dash key) fails everyone time. SHIFT+(any letter) gives me Caps, but never an underscore. Completely frustrating!
You don’t have to start Pico-8 twice, I’m pretty sure there’s just the problem of a static “title screen” in the PocketCHIP edition which isn’t actually part of Pico-8. You have to get past that part to splore first.
Also I have successfully paired a Nintendo Wiimote to my PocketCHIP (by bluetooth) and it detects the D-pad correctly but doesn’t have mappings for any of the other buttons, so… Anybody got bluetooth on their main computer and can run that SDL2 Gamepad Tool to write a mapping for it?
EDIT: After some searching, I think I’ve found what we need. https://github.com/spurious/SDL-mirror/blob/master/test/controllermap.c Download SDL2’s source and compile the test/controllermap.c program, then we can use that to make mappings in a primitive fashion. Now I should be able to make a “sideways wiimote for playing Pico-8” mapping, update the gamecontrollerdb.txt, write a guide to the entire process so anyone else who happens to have a convinient old wireless brick of a controller lying around can do it, and win the game.
If I don’t get lazy, anyway.
EDIT2: Hmm. Looks like Wiimotes aren’t usable. They have some kind of wacky legacy peripheral mapping that assigns the arrow keys to the D-pad and the volume up/down keys to the + and - buttons and nothing else does anything. SDL2 doesn’t detect it as a gamepad, so only the D-pad does anything in Pico-8, and of course it’s mapped the wrong direction to be useful. Oh well.
I wrote the guide to writing your own SDL2 gamepad configurations anyway. Here you go.
installed controllermap, used it to recognize and create my controller mappings ( which went fine) , copied the mapping in sdl_controllers.txt
Once opened pico-8, nothing works, even after rebooting.
I’ve tried various combinations( controllermap uses an xbox layout, so i’ve tried to set my axis to the left stick and the right stick) but pico seems not to recognize it at all.
What i’m missing ? Are there any other tests i can do out of pico-8 to test my controller?