Hi Chips, thanks for reviewing my code and understand the concerns about moving away for base Pandora code. Let me step you through the process I came to this point.
- Currently Custom buttons do not work at all on Raspberry Pi version especially with Joystick (despite the options being there). This is much requested feature and one I would love to have working, so had a shot at it.
So I looked at using the Joystick.cpp to trap the joystick buttons. I managed to get logging working and what I found was, if you held the joystick button down, using SDL_JoystickGetButton, in the log it would not just show the button being pressed but continually being pressed and release some 5 times a second. I could not find a reliable way to trap a button press using that GetButton function without sending continual button press messages. Looking at SDL page for Joystick controls (https://www.libsdl.org/release/SDL-1.2. ... stick.html
) it advises the following:
"While using the functions describe in this section may seem like the best way to access and read from joysticks, in most cases they aren't. Ideally joysticks should be read using the event system."
That got me thinking that Pandora.cpp already uses event trapping for keyboard input, could it work with Joystick button presses more cleanly, and it did. Using that and sending that button press to Pandora-gui.cpp was able to use the custom control logic which was already there with a bit of tweaking.
Your question on the Space key trapping. The default control scheme has the following 'A=Autofire, X=Fire, Y=Space, B=2nd' but Space doesn't work on Raspberry Pi so did a couple of changes as part of the update so that works as standard, certainly not required but if it mentions it listed, it should work ideally so not to confuse novice members who doesn't know what works and doesn't.
Appreciate all your hard work on this project Chips and wanted to try and lend a hand in making an excellent emulator, amazing. I had a couple more changes I was looking to develop (mainly Joystick controls in the menu system and special functions in the custom mappings, like launching menu, quit, load savestates, etc). Would appreciate you opinion and happy to work together, there may be a better way than the code I developed but please take a look at custom mappings along with joystick controls in menu, if I can play games without needing to touch a keyboard (like I do on the Atari ST Emulator) myself and a number of other people here, especially those who use arcade machine style setup would be incredibly happy!