cathery / sys-con

Nintendo Switch sysmodule that allows support for third-party controllers
GNU General Public License v3.0
938 stars 62 forks source link

Request: Ability to set a button to toggle #289

Open lbsbezerra opened 2 years ago

lbsbezerra commented 2 years ago

Hello Cathery!

Would love to somehow add a toggle, i.e. make a button alternate between being continuously held down or not.

It may also be useful to have optional functionality to cause the toggled button, when enabled, to release momentarily when other inputs are activated, to avoid potential issues with some games.

It'd be great if this worked with any input device from USB/Joycons in Handheld mode!

I'm sure there would be various uses but I'm interested in having better control over the camera in Skyward Sword HD. This project seems most relevant.

In the "MissionControl" sysmodule, Banz99 made a fork out of MissionControl and added support for that: https://github.com/Banz99/MissionControl/releases

So Bluetooth controllers are now working flawlessly with this toggle for the "L" button.

Is it possible to do something like that for sys-con too? If it is, can you at least point some directions where I should look at in order to achieve this? I can try forking sys-con and working on this stuff for you.

Thanks!

o0Zz commented 2 weeks ago

Hi @lbsbezerra I maintain a fork of this projet here -> https://github.com/o0Zz/sys-con/releases I'm trying to understand your feature request but I'm not sure to understand it. You want to be able to tell to sys-con ToggleButton=A,B Then A & B will behave as a toggle button meaning when you press it once -> it will be kept pressed and if you press it another time it will be release. Correct ? Now you are talking about "release momentarily" but here I'm not sure to understand in which condition this toggle must be disable ?

Maybe you want a kind of "ToggleMode" Enable/Disable with a button combinaison ? Is it what you are referencing to ? Feel free to re-open this request on my fork and we can deeper discuss about this feature.