Contents Up Previous Next

wxKeyEvent

This event class contains information about keypress (character) events.

Derived from

wxEvent

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.
See also

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


wxKeyEvent::m_altDown

bool m_altDown

TRUE if the Alt key is pressed down.


wxKeyEvent::m_controlDown

bool m_controlDown

TRUE if control is pressed down.


wxKeyEvent::m_keyCode

long m_keyCode

Virtual keycode. See Keycodes for a list of identifiers.


wxKeyEvent::m_metaDown

bool m_metaDown

TRUE if the Meta key is pressed down.


wxKeyEvent::m_shiftDown

bool m_shiftDown

TRUE if shift is pressed down.


wxKeyEvent::m_x

int m_x

X position of the event.


wxKeyEvent::m_y

int m_y

Y position of the event.


wxKeyEvent::wxKeyEvent

wxKeyEvent(WXTYPE keyEventType)

Constructor. Currently, the only valid event types are wxEVT_CHAR and wxEVT_CHAR_HOOK.


wxKeyEvent::AltDown

bool AltDown()

Returns TRUE if the Alt key was down at the time of the key event.


wxKeyEvent::ControlDown

bool ControlDown()

Returns TRUE if the control key was down at the time of the key event.


wxKeyEvent::GetX

float GetX()

Returns the X position of the event.


wxKeyEvent::GetY

float GetY()

Returns the Y position of the event.


wxKeyEvent::KeyCode

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.


wxKeyEvent::MetaDown

bool MetaDown()

Returns TRUE if the Meta key was down at the time of the key event.


wxKeyEvent::Position

void Position(float *x, float *y)

Obtains the position at which the key was pressed.


wxKeyEvent::ShiftDown

bool ShiftDown()

Returns TRUE if the shift key was down at the time of the key event.