typedef struct { GR_EVENT_TYPE type; GR_WINDOW_ID wid; GR_WINDOW_ID subwid; GR_COORD rootx; GR_COORD rooty; GR_COORD x; GR_COORD y; GR_BUTTON buttons; GR_KEYMOD modifiers; } GR_EVENT_MOUSE; |
The GR_EVENT_MOUSE structure is used by nano-X to report changes in the position of the mouse. When the mouse position changes only one mouse event is sent to a client. The event is sent to the highest window that has selected for the event. If the window's parent has also selected for mouse events, nano-X will not send an additional event for the parent window.
If a window has selected both GR_EVENT_TYPE_BUTTON_DOWN and GR_EVENT_TYPE_BUTTON_UP events, nano-X will grab the mouse for that window when a mouse button is first pressed down within that window. While the mouse is grabbed, no mouse button or position events will be delivered to any window except the window that nano-X grabbed the mouse for. The mouse will remain grabbed until all of the mouse buttons are released.
Type | Name | Description |
---|---|---|
GR_EVENT_TYPE | type | The event type will be either a GR_EVENT_TYPE_MOUSE_MOTION or a GR_EVENT_TYPE_MOUSE_POSITION type. |
GR_WINDOW_ID | wid | The ID of the window that the mouse event is being sent to. If the mouse has been grabbed then this is the window that nano-X grabbed the mouse for. In this case the mouse may not actually be positioned over the window any longer. The mouse may be over a child window or it may be outside the window that grabbed the mouse. |
GR_WINDOW_ID | subwid | The ID of the window that the mouse event occurs in. Generally this field will be the same as wid, but in some cases if the mouse event occurs in a decendant of wid, then this field indicates that child window. |
GR_COORD | rootx | The X coordinate of the mouse pointer relative to the root window. |
GR_COORD | rooty | The Y coordinate of the mouse pointer relative to the root window. |
GR_COORD | x | The X coordinate of the mouse pointer relative to the window wid. |
GR_COORD | y | The Y coordinate of the mouse pointer relative to the window wid. |
GR_BUTTON | buttons | Indicates the buttons that are being pressed. |
GR_KEYMOD | modifiers | Indicates the status of the keyboard modifier keys. |