This event class contains information about keypress (character) events.
Derived from
Include files
<wx/event.h>
Event table macros
To process a key event, use these event handler macros to direct input to member functions that take a wxKeyEvent argument.
EVT_CHAR(func) | Process a wxEVT_CHAR event (a non-modifier key has been pressed). |
EVT_KEY_DOWN(func) | Process a wxEVT_KEY_DOWN event (any key has been pressed). |
EVT_KEY_UP(func) | Process a wxEVT_KEY_UP event (any key has been released). |
EVT_CHAR(func) | Process a wxEVT_CHAR event. |
EVT_CHAR_HOOK(func) | Process a wxEVT_CHAR_HOOK event. |
wxWindow::OnChar, wxWindow::OnCharHook, wxWindow::OnKeyDown, wxWindow::OnKeyUp
Members
wxKeyEvent::m_altDown
wxKeyEvent::m_controlDown
wxKeyEvent::m_keyCode
wxKeyEvent::m_metaDown
wxKeyEvent::m_shiftDown
wxKeyEvent::m_x
wxKeyEvent::m_y
wxKeyEvent::wxKeyEvent
wxKeyEvent::AltDown
wxKeyEvent::ControlDown
wxKeyEvent::GetX
wxKeyEvent::GetY
wxKeyEvent::KeyCode
wxKeyEvent::MetaDown
wxKeyEvent::Position
wxKeyEvent::ShiftDown
bool m_altDown
TRUE if the Alt key is pressed down.
bool m_controlDown
TRUE if control is pressed down.
long m_keyCode
Virtual keycode. See Keycodes for a list of identifiers.
bool m_metaDown
TRUE if the Meta key is pressed down.
bool m_shiftDown
TRUE if shift is pressed down.
int m_x
X position of the event.
int m_y
Y position of the event.
wxKeyEvent(WXTYPE keyEventType)
Constructor. Currently, the only valid event types are wxEVT_CHAR and wxEVT_CHAR_HOOK.
bool AltDown()
Returns TRUE if the Alt key was down at the time of the key event.
bool ControlDown()
Returns TRUE if the control key was down at the time of the key event.
float GetX()
Returns the X position of the event.
float GetY()
Returns the Y position of the event.
long KeyCode()
Returns the virtual key code. ASCII events return normal ASCII values, while non-ASCII events return values such as WXK_LEFT for the left cursor key. See Keycodes for a full list of the virtual key codes.
bool MetaDown()
Returns TRUE if the Meta key was down at the time of the key event.
void Position(float *x, float *y)
Obtains the position at which the key was pressed.
bool ShiftDown()
Returns TRUE if the shift key was down at the time of the key event.