Timeline for Getting button click type
Current License: CC BY-SA 4.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 12, 2020 at 18:00 | history | tweeted | twitter.com/StackRaspi/status/1271502539381448706 | ||
Jun 18, 2019 at 7:34 | comment | added | GIMBorgo | @Milliways, thank you for pointing out that option, I'll check it out! | |
Jun 16, 2019 at 3:43 | comment | added | tlfong01 | I forgot to say why you idea is good. I have been playing with 4 key to 16 key keypads. Now I hope to use only one key to represent more than one thing I wish to do. So if I press a key shortly, I would hear one beep. If I press longer, say, 4 seconds, then I would hear 4 beeps and meaning that I want number 4. Of course it is nothing new, many home appliances like induction cooker for example might have 4 or 5 buttons and one LCD display to replace a 16 key keypad. This is sort of UI, user interface design, and getting important in IoT devices with little space for large keypads. | |
Jun 16, 2019 at 3:32 | comment | added | tlfong01 | You program is good. I neither have read program differentiating short, long, and multiple clicks. Many programs might deal with things like software debouncing etc, but that is not what you are interested here. I read (but I have not tried) that other hackers might use event driven interrupt functions to detect button clicks. They also use python "dictionary" datatype to define click types. I often use dictionaries to define new things. This way you can easily expand or structure up you dictonary WITHOUT modifying you procedural function by adding more elif's, thus no so error prone. | |
Jun 15, 2019 at 23:53 | comment | added | Milliways | It would be simpler to use the held options in gpiozero.readthedocs.io/en/stable/api_input.html#button | |
Jun 15, 2019 at 23:20 | review | First posts | |||
Jun 16, 2019 at 8:20 | |||||
Jun 15, 2019 at 23:17 | history | asked | GIMBorgo | CC BY-SA 4.0 |