Fundamental_Concepts
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| Fundamental_Concepts [2025/02/05 02:45] – peternlewis | Fundamental_Concepts [2025/07/25 08:06] (current) – peternlewis | ||
|---|---|---|---|
| Line 47: | Line 47: | ||
| You can use the [[action: | You can use the [[action: | ||
| + | |||
| + | ==== The System Event Queue ==== | ||
| + | |||
| + | When UI events happen (press key, move or click mouse, etc), including when Keyboard Maestro simulates them, they are placed in the event queue which is a system wide queue. A big part of what an application does is run a loop that extracts the next event from that queue and handles it. | ||
| + | |||
| + | So the application asks the system for the next event, and the system looks at the event and decides what to do - maybe the event is a keystrokes and so the system checks if it is a registered hot key, and if so that is handled in one way, or it is a key press so the system goes through a complicated process checking whether the key is a menu shortcut matching an enabled menu, or something that the window can handle, which in turn looks at something the focused item or its parents can handle. | ||
| + | |||
| + | If nothing can be found to handle the key, then the system might decide to make a beep alert noise and drop the event. | ||
| + | |||
| + | This is also why it's impossible to safely do things like capture a key and then decide to allow it to be handled as a normal key, because the only way to do that would be to put it in the event back in the queue. Since you can only add events to the end of the queue and read events from the start of the queue, taking an event out, looking at it and putting it back means it is placed out of order. You cannot shove the event back in at the start of the queue, only add it to the end. | ||
| + | |||
| + | It's also a typical source of issues needing a Pause because the event queue means that events that are simulated will be handled when the application is ready to handle them, but if you change the focus (activate an application, | ||
| + | |||
| + | |||
Fundamental_Concepts.1738723546.txt.gz · Last modified: by peternlewis
