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_KEY ch; GR_SCANCODE scancode; } GR_EVENT_KEYSTROKE; |
The GR_EVENT_KEYSTROKE structure is used by nano-X to pass the application keyboard events.
The keystroke will be sent to the highest window that contains the mouse cursor and has selected to receive keystroke events, if that window is a decendant of the focus window. Otherwise the keystroke is sent to the focus window or it's highest ancestor that has selected to receive keystroke events.
Type | Name | Description |
---|---|---|
GR_EVENT_TYPE | type | The event type will be either a GR_EVENT_TYPE_KEY_DOWN or a GR_EVENT_TYPE_KEY_UP type. |
GR_WINDOW_ID | wid | The ID of the window that the keystroke event is being sent to. |
GR_WINDOW_ID | subwid | The ID of the window that the mouse is 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 mouse buttons that are being pressed. |
GR_KEYMOD | modifiers | Indicates the status of the keyboard modifier keys. |
GR_KEY | ch | The key that caused the keystroke event. |
GR_SCANCODE | scancode | The OEM scancode for the key if it is available. |