screen_send_event()

Updated: October 28, 2024

Send an input event to a process

Synopsis:

#include <screen/screen.h>
int screen_send_event(screen_context_t ctx,
                      screen_event_t ev,
                      pid_t pid)

Arguments:

ctx
A context within Screen that was created with screen_create_context().
ev
An event handle that was created with screen_create_event(). This event must contain all the relevant event data pertaining to its type when injected into the system.
pid
The process the event is to be sent to.

Library:

libscreen

Description:

Function Type: Immediate Execution

A window manager and an input provider can use this function when they need to inject an event in the system. Prior to calling screen_send_event(), you must have set all relevant event properties to valid values, especially the event type property. To send input events, you must be

Returns:

0 if successful, or -1 if an error occurred (errno is set; refer to errno.h for more details).

  翻译: