-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added config and handling for special game controller buttons to quit and reset display. #77
Conversation
… and reset display.
…sed by users of the M8 device.
I ended up reverting the removal of the original key combo for reset display since it may be (and probably is) used by users of the M8. |
…rts. Read the database BEFORE trying to read the game controller. Check for the user's game controller db if found, or fall back to the one included in the m8c directory.
Added the game controller definitions from @jasonporrit's scripts |
Initialize the game controllers if they are plugged in before m8c starts. Read the database BEFORE trying to read the game controller - Basically, reading the database has to happen before assigning the joystick or it doesn't register as a gamepad. Check for the user's game controller db if found in their config dir, or fall back to the one included in the m8c directory. |
…y because it is not cross-platform.
Changed strategy to use SDL functions only and removed stat.h strategy because it is not cross-platform. (a839ff9) Ideally what should happen here is : try to get the gamecontroller db from the user pref directory; If it doesn't exist, then create it from the included one, and then try to open it. If that fails, then read the included db file. |
…wait_for_device=true, would repeatedly reset the device in the Effects Help screen.
RE: device disconnect detection. For some reason, the Effects Help screen causes the m8 (or headless) to send zero bytes and appear disconnected. One workaround by setting wait_for_device in the config file = true, but I had to reset the zero byte counter in the device disconnect code block, otherwise the zero counter would cause a display reset repeatedly with no delay. The other was to add a longer disconnect timeout, which I defaulted to 15 seconds and made configurable. |
…o not start device disconnect detection while user is pressing buttons. This allows the user to stay on the Effect Help screen indefinitely, since thay have the 'EDIT' button pressed the whole time. If unit is disconnected, m8c shutsdown after ~2 seconds.
I'm really sorry if I am overwhelming you with changes. |
Maybe adding a config parameter for the zero byte timeout is overkill, but the changes to reset the zero byte counter while the user has a button pressed does keep the m8c from shutting down on the Effects Help screen. |
Sorry for the delay with checking this - work, family and weekly beats have taken all my time lately :) |
Looks like the fx palette reset still happens when using M8 hw buttons for navigation. It probably needs a better check for timeout than the current 0byte system, this is probably best addressed in a separate issue... I didn't have a gamepad to test the quit buttons with but I'll assume it works :) |
Sorry, I'm still awaiting my hardware M8 in the next shipment, so I couldn't test the zerobyte behavior with one. :( |
No worries :) The HW unit sends packets that contain the keypress+ID of the current view. That could be used with the current solution but it's probably a better idea to find some other way. |
I found some other way - see new PR with just a tiny change I believe should work in all cases due to the port reset behavior on entering the loop when port==null. |
On a game controller, using the M8 defined buttons can cause conflicts with defined M8 functionality, or simply fail to quit in the case of no attached keyboard to execute a quit. I added special game controller configs to quit and reset the display using any of the unused/unmapped to M8 buttons in combination with the defined "Select" button. The defaults are quit = select + SDL_CONTROLLER_BUTTON_RIGHTSTICK and reset display = select + SDL_CONTROLLER_BUTTON_LEFTSTICK.