Module event

Source
Expand description

Representation of keyboard and mouse events.

When an event is generated, EventReceiver::recv can be called to receive the event. The received event is blocked (other programs are not yet notified).

Calling NativeEventHandler::block will continue blocking and no notification will be made. Alternatively, calling NativeEventHandler::dispatch will notify other programs of the event. If neither is called, the event is notified.

§Warning

On Windows, Calling function that perform input (e.g. Button::press) before calling NativeEventHandler::block or NativeEventHandler::dispatch will take time. Therefore, call these functions before calling function that performs the input.

§Examples

let rx = hookmap_core::install_hook();
while let Ok((event, native_handler)) = rx.recv() {
    // Blocks all the events
    native_handler.block();
}

Structs§

ButtonEvent
Indicates button event.
CursorEvent
Indicates mouse cursor event.
NativeEventHandler
Decide whether to notify other programs of generated events.
WheelEvent
Indicates mouse wheel event.

Enums§

Event
An event
NativeEventOperation
Indicates whether to pass the generated event to the next program or not.

Type Aliases§

EventReceiver