#include <LibraryMessages.h>
Public Member Functions | |
KeyEventMsg (unsigned int key, int state) | |
KeyEventMsg (MessageInstancePtr msg) | |
virtual | ~KeyEventMsg () |
unsigned int | GetKey () const |
int | GetState () const |
virtual MessageInstancePtr | Instantiate (Key msgTemplate, MessageTemplateTablePtr table) |
Static Public Member Functions | |
static MessageTemplatePtr | CreateTemplate () |
Protected Attributes | |
unsigned char | mKey |
int | mState |
green::KeyEventMsg::KeyEventMsg | ( | unsigned int | key, | |
int | state | |||
) | [inline] |
Must use this constructor to set the key and state for the new message. For debugging purposes, you can also use the KeyEventMsg(MessageInstancePtr) constructor to parse an existing KeyEventMsg
key | The key that was pressed or released (ascii value) | |
state | The state of the key (0 for released, 1 for pressed) |
green::KeyEventMsg::KeyEventMsg | ( | MessageInstancePtr | msg | ) | [inline] |
Parse a MessageInstance to extract the information subclasses should provide accessor methods for that parsed information
msg | The MessageInstance to parse |
virtual green::KeyEventMsg::~KeyEventMsg | ( | ) | [inline, virtual] |
Default destructor declared virtual
unsigned int green::KeyEventMsg::GetKey | ( | ) | const [inline] |
Get the key that was pressed or released
int green::KeyEventMsg::GetState | ( | ) | const [inline] |
Get the state of the key
virtual MessageInstancePtr green::KeyEventMsg::Instantiate | ( | Key | msgTemplate, | |
MessageTemplateTablePtr | table | |||
) | [inline, virtual] |
Instantiate a MessageInstance from a MessageTemplateTable.
msgType | The MessageTemplate Key for the type of message to instantiate | |
table | The MessageTemplateTable to instantiate from |
static MessageTemplatePtr green::KeyEventMsg::CreateTemplate | ( | ) | [inline, static] |
Create a new MessageTempalte for this kind of template