Skip to content
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

Time limits on button activation #177

Open
dehrhart opened this issue Sep 5, 2024 · 2 comments
Open

Time limits on button activation #177

dehrhart opened this issue Sep 5, 2024 · 2 comments

Comments

@dehrhart
Copy link

dehrhart commented Sep 5, 2024

Currently I use switch modifiers from EnablingDevices to limit the activation period of a button presses. It really helps helps students with motor processing disorders not spin in circles in games like MarioKart and Minecraft. It would be great to be able to do this with HID Remapper on a Adafruit feather (smaller and less expensive). The joystick in the image is just a switch joystick which works great with the D-pad. It would be great to be able to set activation limits on simple buttons and regular joysticks. Basically just set to off until the component is re-engaged.
Thanks!

PXL_20240905_181038293

@jfedor2
Copy link
Owner

jfedor2 commented Sep 9, 2024

Here's a configuration that applies a 1 second timeout on all buttons and the d-pad:

hid-remapper-gamepad-timeout.json

I hope I understood your question correctly. This is assuming you're plugging the Flex into HID Remapper and HID Remapper into the Switch.

The implementation is different for the buttons and for the dpad. For the buttons it uses HID Remapper's built-in "hold" state and the timeout threshold is controlled by the "tap/hold threshold" setting in the Settings tab. For the d-pad it's implemented manually with an expression (change the "1000" (milliseconds) value in Expression 2 to change the timeout).

I admit that this isn't very straightforward, but there is no built-in way to do it.

The dummy mappings with "Nothing" as output are there just so that HID Remapper knows to keep the "hold" state that is then used in Expression 1. They do nothing by themselves.

If you don't want the timeout behavior on some button, just delete the two mappings that mention it as input or output.

If you want different timeout values per button then each would have to be implemented similarly to the d-pad.

@dehrhart
Copy link
Author

Thanks! I'll definitely be trying it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants