#include "CrabClaw/types.h"Data Structures | |
| struct | cc_event |
| An event to be passed to the user program. More... | |
Typedefs | |
| typedef struct cc_event | cc_event_t |
| An event to be passed to the user program. | |
Enumerations | |
| enum | cc_event_type_t { CC_KEY_DOWN_EVENT = 1, CC_KEY_UP_EVENT, CC_MOUSE_BUTTON_DOWN_EVENT, CC_MOUSE_BUTTON_UP_EVENT, CC_MOUSE_DRAGGED_EVENT, CC_JOYSTICK_BUTTON_DOWN_EVENT, CC_JOYSTICK_BUTTON_UP_EVENT, CC_JOYSTICK_AXIS_MOTION_EVENT, CC_QUIT_EVENT = 0xFFFFFFFE, CC_INVALID_EVENT = 0xFFFFFFFF } |
| Event Types. More... | |
Functions | |
| int | cc_event_peek (cc_event_t *event) |
| Copy the top event on the queue into the passed structure. | |
| int | cc_event_pop (cc_event_t *event) |
| Pop the top event on the queue into the passed structure. | |
| int | cc_event_push (cc_event_t *event) |
| Push an event onto the bottom of the queue. | |
| char | cc_event_translate_key (cc_event_t *event) |
| Translate a key up or down event into a character. | |
| typedef struct cc_event cc_event_t |
An event to be passed to the user program.
An event is a small amount of data that is passed to the user program from the operating system below. Various types of events exist. For a reference of these events, consult the cc_event_type_t documentation
| enum cc_event_type_t |
Event Types.
Each Event queued must be of one of these types.
| int cc_event_peek | ( | cc_event_t * | event | ) |
Copy the top event on the queue into the passed structure.
This function copies the top event from the event queue into the passed pointer, without removing it from the queue.
| event | The destination for the top event in the queue. |
| int cc_event_pop | ( | cc_event_t * | event | ) |
Pop the top event on the queue into the passed structure.
This function pops the top event from the event queue into the passed pointer, removing it from the queue.
| event | The destination for the top event in the queue. |
| int cc_event_push | ( | cc_event_t * | event | ) |
Push an event onto the bottom of the queue.
This function is generally used only internally in order to push operating system level events onto the event queue. It can however be used by a user program, if the programmer desires to simulate events.
| event | The event to be added to the queue. |
| char cc_event_translate_key | ( | cc_event_t * | event | ) |
Translate a key up or down event into a character.
This function translates a key up or key down event into its printable (if applicable) character, taking into account the shift modifier if it is being asserted in the event. This function has no effect if the type field of the event is not CC_KEY_DOWN_EVENT or CC_KEY_UP_EVENT.
| event | The event to be translated. |