Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

dtk_process_events(3) [debian man page]

DTK_PROCESS_EVENTS(3)						Draw Toolkit manual					     DTK_PROCESS_EVENTS(3)

NAME
dtk_process_events, dtk_set_event_handler - Events processing SYNOPSIS
#include <dtk_event.h> typedef int (*DTKEvtProc)(dtk_hwnd, int, const union dtk_event*); void dtk_set_event_handler(dtk_hwnd wnd, DTKEvtProc handler); int dtk_process_events(dtk_hwnd wnd); DESCRIPTION
dtk_set_event_handler() set handler as the current event handler for the window wnd. handler is a function that has arguments in the fol- lowing order: * a reference of type dtk_hwnd to the window that has received the event. * the type ID of the event. * a pointer to a union dtk_event holding event-specific data (if not NULL) defined as follows: union dtk_event { struct dtk_keyevent key; struct dtk_mouseevent mouse; }; dtk_process_events() processes pending events in the event queues associated to the window referenced by wnd, i.e. for each event in the queue, it calls the event handler that has been set by dtk_set_event_handler(). dtk_process_events() returns if a event handler has returned 0 or if there is no more pending event in the queue. If dtk_set_event_handler() has never been called or called with handle as NULL, it use a minimalistic event handler that returns 0 (i.e. stop the loop) when pressing the close button on the window. The type ID of the event can be one of the following: DTK_EVT_REDRAW This event indicates that the whole window or parts of it must be redrawn. This may be caused by another window has been overlapped it or the window has been resized. If such an event is received, the event pointer passed to the handler will be NULL. DTK_EVT_QUIT This event indicates that the close button of the window has been clicked. The event pointer passed will be NULL. DTK_EVT_KEYBOARD Indicates that a key of the keyboard has been pressed or released. If such an event is received, the meaningfull member of the union dtk_event will be key which is defined as follows: struct dtk_keyevent { unsigned int state; /* pressed or released */ unsigned int sym; /* Symbolic code of the key */ unsigned int mod; /* modifiers key */ }; DTK_EVT_MOUSEBUTTON This event indicates that one of the mouse buttons has been pressed or released. If such an event is received, the meaningfull mem- ber of the union dtk_event will be mouse which is defined as follows: struct dtk_mouseevent { unsigned int button; /* button identifier */ unsigned int state; /* pressed or realeased */ unsigned int x; /* x-coordinate of the mouse position */ unsigned int y; /* y-coordinate of the mouse position */ }; DTK_EVT_MOUSEMOTION This is similar to the DTK_EVT_MOUSEBUTTON but indicates that the mouse has moved. Event data should also be accessed through mouse member but its button and state members will be meaningless. RETURN VALUE
dtk_set_event_handler() does not return value. dtk_process_events() returns 1 if there is no more pending event in the queue. It returns 0 if the processing loop has been interrupted by an event handler, i.e. the last event handler has returned 0. EPFL
2010 DTK_PROCESS_EVENTS(3)

Check Out this Related Man Page

xcb_button_release_event_t(3)					    XCB Events					     xcb_button_release_event_t(3)

NAME
xcb_button_release_event_t - a mouse button was pressed/released SYNOPSIS
#include <xcb/xproto.h> Event datastructure typedef struct xcb_button_release_event_t { uint8_t response_type; xcb_button_t detail; uint16_t sequence; xcb_timestamp_t time; xcb_window_t root; xcb_window_t event; xcb_window_t child; int16_t root_x; int16_t root_y; int16_t event_x; int16_t event_y; uint16_t state; uint8_t same_screen; uint8_t pad0; } xcb_button_release_event_t; EVENT FIELDS
response_type The type of this event, in this case XCB_BUTTON_RELEASE. This field is also present in the xcb_generic_event_t and can be used to tell events apart from each other. sequence The sequence number of the last request processed by the X11 server. detail The keycode (a number representing a physical key on the keyboard) of the key which was pressed. time Time when the event was generated (in milliseconds). root The root window of child. event NOT YET DOCUMENTED. child NOT YET DOCUMENTED. root_x The X coordinate of the pointer relative to the root window at the time of the event. root_y The Y coordinate of the pointer relative to the root window at the time of the event. event_x If same_screen is true, this is the X coordinate relative to the event window's origin. Otherwise, event_x will be set to zero. event_y If same_screen is true, this is the Y coordinate relative to the event window's origin. Otherwise, event_y will be set to zero. state The logical state of the pointer buttons and modifier keys just prior to the event. same_screen Whether the event window is on the same screen as the root window. DESCRIPTION
SEE ALSO
xcb_generic_event_t(3), xcb_grab_pointer(3), xcb_grab_button(3) AUTHOR
Generated from xproto.xml. Contact xcb@lists.freedesktop.org for corrections and improvements. XCB
2014-06-10 xcb_button_release_event_t(3)
Man Page