Timeline for Is there a reliable way read an existing event, if any, and remove it from the queue with zero delay?
Current License: CC BY-SA 4.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 29, 2022 at 13:12 | history | edited | phils | CC BY-SA 4.0 |
added 370 characters in body
|
Sep 29, 2022 at 12:35 | comment | added | user13929 | Thanks - I appreciate the feedback and investigations! | |
Sep 29, 2022 at 12:22 | comment | added | phils |
I suspect keyboard.c is the code to read if you really want to get into the details (input-pending-p takes us to get_input_pending , at which point things immediately get low-level, and entirely outside of my area of knowledge).
|
|
Sep 29, 2022 at 12:17 | comment | added | phils | Nice one. With some extra messaging I can see that the three unread event lists I mentioned seem to remain empty while a key press within that first 5 seconds is pending, so it looks like your original understanding is correct -- such events are waiting in some other event queue which cannot be processed while other elisp is being actively executed. | |
Sep 28, 2022 at 22:10 | comment | added | user13929 | Ah! I missed your test after reading your earlier comment. Awesome! I’ll cook something up. Thanks! | |
Sep 28, 2022 at 21:34 | comment | added | phils | If you can provide an example of it working differently, that would no doubt help. | |
Sep 28, 2022 at 13:53 | comment | added | user13929 | Yeah, that's what I expect, but I don't think it's the case. I ended up rewriting what I was doing to use a timer instead and add a little dynamics into the mix anyway, but I'd still like to understand... | |
Sep 28, 2022 at 9:59 | history | edited | phils | CC BY-SA 4.0 |
added 479 characters in body
|
Sep 28, 2022 at 9:58 | comment | added | phils |
Beyond the fact that there are at least three different "unread events" lists, I'm not certain of the details; but I would have expected the result to be the same regardless -- if there's an event waiting in a queue and you call read-event I would expect the waiting event to be returned in all cases.
|
|
Sep 26, 2022 at 3:49 | comment | added | user13929 |
Do events normally flow to unread-command-events ? From the docs I thought this was a sort of "pushback stack", and events would only go on that list if a function read it from the standard queue, then decided it didn't want it.
|
|
Sep 26, 2022 at 3:25 | history | answered | phils | CC BY-SA 4.0 |