Click here to Skip to main content
15,888,461 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Christmas meme Pin
obermd9-Dec-22 9:29
obermd9-Dec-22 9:29 
GeneralRe: Christmas meme Pin
Al_Brown9-Dec-22 9:40
Al_Brown9-Dec-22 9:40 
GeneralRe: Christmas meme Pin
trønderen9-Dec-22 10:22
trønderen9-Dec-22 10:22 
Generalworldle 321 Pin
jmaida8-Dec-22 12:44
jmaida8-Dec-22 12:44 
GeneralIt appears the ChatGPT is down. Pin
Matthew Dennis8-Dec-22 8:39
sysadminMatthew Dennis8-Dec-22 8:39 
GeneralRe: It appears the ChatGPT is down. Pin
Matthew Dennis8-Dec-22 8:41
sysadminMatthew Dennis8-Dec-22 8:41 
GeneralRe: It appears the ChatGPT is down. Pin
peterkmx11-Dec-22 8:21
professionalpeterkmx11-Dec-22 8:21 
Generalbutton part deux Pin
honey the codewitch8-Dec-22 8:31
mvahoney the codewitch8-Dec-22 8:31 
my last button implementation works okay, but it can sometimes report events out of order because it doesn't actually queue events. In the case of a click followed by a long click, the long click will be reported first if they're close enough together. This may work for simple UI scenarios, but nothing polished.

so what i did was i made the button (optionally) interrupt based. on the interrupt it logs a timestamp and whether the button was pressed or depressed into a circular buffer.

the idea then is when you call update() next (the cooperatively threaded "pump" method) it will parse the contents of that circular buffer and fire callbacks as necessary.

It seems simple, but long clicks, and multi-clicks, plus the case where you hold the button down on startup complicate things.

parsing button clicks reminds me of parsing the contents of [] brackets in regex, esp since you could do stuff like [[[:alpha:]]-a-z]

all this for a button. seems simple, right? WTF | :WTF:
To err is human. Fortune favors the monsters.

GeneralRe: button part deux Pin
jmaida8-Dec-22 12:26
jmaida8-Dec-22 12:26 
GeneralRe: button part deux Pin
jmaida8-Dec-22 12:46
jmaida8-Dec-22 12:46 
GeneralRe: button part deux Pin
honey the codewitch8-Dec-22 13:11
mvahoney the codewitch8-Dec-22 13:11 
GeneralRe: button part deux Pin
jmaida8-Dec-22 14:32
jmaida8-Dec-22 14:32 
GeneralRe: button part deux Pin
Sander Rossel8-Dec-22 20:34
professionalSander Rossel8-Dec-22 20:34 
GeneralMicrosoft in a closed loop ... Pin
Richard MacCutchan8-Dec-22 4:21
mveRichard MacCutchan8-Dec-22 4:21 
GeneralRe: Microsoft in a closed loop ... Pin
OriginalGriff8-Dec-22 4:41
mveOriginalGriff8-Dec-22 4:41 
GeneralReboot Fixes Everything PinPopular
Slacker0078-Dec-22 2:45
professionalSlacker0078-Dec-22 2:45 
JokeRe: Reboot Fixes Everything Pin
Daniel Pfeffer8-Dec-22 3:58
professionalDaniel Pfeffer8-Dec-22 3:58 
GeneralRe: Reboot Fixes Everything Pin
Slacker0078-Dec-22 4:27
professionalSlacker0078-Dec-22 4:27 
GeneralRe: Reboot Fixes Everything Pin
trønderen8-Dec-22 11:08
trønderen8-Dec-22 11:08 
GeneralRe: Reboot Fixes Everything Pin
Nelek8-Dec-22 23:17
protectorNelek8-Dec-22 23:17 
GeneralRe: Reboot Fixes Everything Pin
Sander Rossel8-Dec-22 20:36
professionalSander Rossel8-Dec-22 20:36 
GeneralRe: Reboot Fixes Everything Pin
Amarnath S8-Dec-22 7:15
professionalAmarnath S8-Dec-22 7:15 
GeneralRe: Reboot Fixes Everything Pin
Slacker0078-Dec-22 7:20
professionalSlacker0078-Dec-22 7:20 
GeneralRe: Reboot Fixes Everything Pin
fgs19638-Dec-22 7:35
fgs19638-Dec-22 7:35 
GeneralRe: Reboot Fixes Everything Pin
Chris C-B8-Dec-22 19:50
Chris C-B8-Dec-22 19:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.