settings: Allow clearing a joystick button mapping - #325
Conversation
The per button mapping menu in the joystick settings adds a "None" entry followed by one entry per frontend hotkey. The hotkey entries are wired to on_menuAction(), but the "None" entry was added without connecting its triggered() signal, so selecting it did nothing and a button could never be set back to unmapped. Connect the "None" action like the others. It carries no data, so on_menuAction() forwards an empty hotkey name, which setJoystickButtonHotkey() already treats as "remove the mapping". Closes glikely#269 Reported-by: BillyBob1354 Signed-off-by: Eddy Weiz <eddyweiz@gmail.com>
|
As per others, please test before opening a PR |
|
Status on this one, so it is not just sitting here silently. I have now built from source and tested #324, #327, #329 and #270 locally against OBS Studio 32.2.1 on Windows, and this is the one I cannot honestly claim to have tested: I have no game controller. Joystick support is compiled in and the option is enabled, but the device list stays empty, so there are no button rows and therefore no "None" entry to click. What I can say about the change without a controller: the "None" action is created alongside the hotkey actions but was never connected to I would rather leave it closed than reopen it on that basis. If you would like it anyway, say so and I will reopen; otherwise it stays here until I can get hold of a controller and do it properly, including the restart check that the removal really lands in the config. |
|
Thanks for reopening. I found a way to test it after all, so here is the evidence rather than the hand-waving. How I got a joystick without owning one. QJoysticks ships a keyboard-driven virtual joystick, which the plugin explicitly turns off in Versions as logged by the plugin on load:
Without the patch. Button 0 mapped to "Next Camera". Opening the button menu and choosing "None" leaves the label reading "Next Camera". Nothing happens. That is #269. With the patch. Same starting point — the mapping survived a rebuild and reinstall, so it really came back from So the mapping is genuinely removed and persisted, not just blanked in the UI. One thing I fell over while setting this up, unrelated to this change: with Still no physical controller here, so what I verified is the menu behaviour and the persisted config, not an actual button press on hardware. |
|
Merged, thanks |
Fixes #269.
In the joystick button mapping menu, every hotkey entry is wired to on_menuAction(), but the "None" entry was added without connecting its triggered() signal - so selecting "None" did nothing and a button could never be set back to unmapped.
The "None" action is now connected like the others. It carries no data, so on_menuAction() forwards an empty hotkey name, which setJoystickButtonHotkey() already treats as "remove the mapping".
Built cleanly on Ubuntu, macOS and Windows via CI.