meshtastic / firmware

Meshtastic device firmware
https://meshtastic.org
GNU General Public License v3.0
3.21k stars 776 forks source link

[Feature Request]: Expose "Multi Click" time as a user variable #3805

Closed rc-adammikolajczyk closed 3 months ago

rc-adammikolajczyk commented 3 months ago

Platform

NRF52, ESP32

Description

I've installed a user-button on my RAK19700 base board by wiring in a momentary switch between GND and AIN1 per the docs here: https://store.rokland.com/pages/adding-a-user-button-rak19007

I'm having trouble accurately making multi-clicks, however. I suspect this is more to do with the physical nature of my analog switches. Think more of a doorbell type momentary switch rather than a surface mount. image

If I'm not mistaken, the code shows a "click' to be a press between 1-250ms. It would be advantageous to expose that upper threshold as a user-variable, such that one might set the multi-click rate to something like 500ms - or whatever works for their particular hardware context. https://github.com/meshtastic/firmware/blob/70712d859cdc242b1873fa9b9622cf1c1711fb06/src/ButtonThread.cpp#L53-L64

Obviously, not a huge priority, but a nice quality of life update if it doesn't inadvertently impact other areas.

todd-herbert commented 3 months ago

I've been testing out a longer click time on my T-Echo for a week or two now and definitely think it's an improvement. The code change I've had lined up allows a custom click time to be set in a devices variant.h file, at compile time. This makes sense for a device like the T-Echo, but I can see also that your use case is different again, being a custom build.