Event Hooks
EventHooks run before each event from the X server is processed, allowing you to provide your
own custom handling of events. You are free to run whatever code you want in response to events
and you are also able to decide whether or not the built-in event handling should run after you
are done: if you return Ok(true)
from your hook then the processing will continue, if you return
Ok(false)
then it will stop.
If you do decide to skip default handling you should check carefully what it is that you are skipping. The main event handling logic can be found here in the core module.
As with the other hooks, there is a compose_or_set method on Config
to help you combine
multiple event hooks together without accidentally overwriting anything along the way.
NOTE: EventHooks are run in order and the first hook to say that no further processing should take place will short circuit any remaining composed event hooks and the default handling!