1 \section{\class{wxKeyEvent
}}\label{wxkeyevent
}
3 This event class contains information about keypress (character) events.
5 \wxheading{Derived from
}
7 \helpref{wxEvent
}{wxevent
}
9 \wxheading{Include files
}
13 \wxheading{Event table macros
}
15 To process a key event, use these event handler macros to direct input to member
16 functions that take a wxKeyEvent argument.
19 \begin{twocollist
}\itemsep=
0pt
20 \twocolitem{{\bf EVT
\_CHAR(func)
}}{Process a wxEVT
\_CHAR event (a non-modifier key has been pressed).
}
21 \twocolitem{{\bf EVT
\_KEY\_DOWN(func)
}}{Process a wxEVT
\_KEY\_DOWN event (any key has been pressed).
}
22 \twocolitem{{\bf EVT
\_KEY\_UP(func)
}}{Process a wxEVT
\_KEY\_UP event (any key has been released).
}
23 \twocolitem{{\bf EVT
\_CHAR(func)
}}{Process a wxEVT
\_CHAR event.
}
24 \twocolitem{{\bf EVT
\_CHAR\_HOOK(func)
}}{Process a wxEVT
\_CHAR\_HOOK event.
}
29 \helpref{wxWindow::OnChar
}{wxwindowonchar
},
30 \helpref{wxWindow::OnCharHook
}{wxwindowoncharhook
},
31 \helpref{wxWindow::OnKeyDown
}{wxwindowonkeydown
},
32 \helpref{wxWindow::OnKeyUp
}{wxwindowonkeyup
}
34 \latexignore{\rtfignore{\wxheading{Members
}}}
36 \membersection{wxKeyEvent::m
\_altDown}
38 \member{bool
}{m
\_altDown}
40 TRUE if the Alt key is pressed down.
42 \membersection{wxKeyEvent::m
\_controlDown}
44 \member{bool
}{m
\_controlDown}
46 TRUE if control is pressed down.
48 \membersection{wxKeyEvent::m
\_keyCode}
50 \member{long
}{m
\_keyCode}
52 Virtual keycode. See
\helpref{Keycodes
}{keycodes
} for a list of identifiers.
54 \membersection{wxKeyEvent::m
\_metaDown}
56 \member{bool
}{m
\_metaDown}
58 TRUE if the Meta key is pressed down.
60 \membersection{wxKeyEvent::m
\_shiftDown}
62 \member{bool
}{m
\_shiftDown}
64 TRUE if shift is pressed down.
66 \membersection{wxKeyEvent::m
\_x}
70 X position of the event.
72 \membersection{wxKeyEvent::m
\_y}
76 Y position of the event.
78 \membersection{wxKeyEvent::wxKeyEvent
}
80 \func{}{wxKeyEvent
}{\param{WXTYPE
}{ keyEventType
}}
82 Constructor. Currently, the only valid event types are wxEVT
\_CHAR and wxEVT
\_CHAR\_HOOK.
84 \membersection{wxKeyEvent::AltDown
}
86 \func{bool
}{AltDown
}{\void}
88 Returns TRUE if the Alt key was down at the time of the key event.
90 \membersection{wxKeyEvent::ControlDown
}
92 \func{bool
}{ControlDown
}{\void}
94 Returns TRUE if the control key was down at the time of the key event.
96 \membersection{wxKeyEvent::GetX
}
98 \func{float
}{GetX
}{\void}
100 Returns the X position of the event.
102 \membersection{wxKeyEvent::GetY
}
104 \func{float
}{GetY
}{\void}
106 Returns the Y position of the event.
108 \membersection{wxKeyEvent::KeyCode
}
110 \func{long
}{KeyCode
}{\void}
112 Returns the virtual key code. ASCII events return normal ASCII values,
113 while non-ASCII events return values such as
{\bf WXK
\_LEFT} for the
114 left cursor key. See
\helpref{Keycodes
}{keycodes
} for a full list of the virtual key codes.
116 \membersection{wxKeyEvent::MetaDown
}
118 \func{bool
}{MetaDown
}{\void}
120 Returns TRUE if the Meta key was down at the time of the key event.
122 \membersection{wxKeyEvent::Position
}
124 \func{void
}{Position
}{\param{float *
}{x
},
\param{float *
}{y
}}
126 Obtains the position at which the key was pressed.
128 \membersection{wxKeyEvent::ShiftDown
}
130 \func{bool
}{ShiftDown
}{\void}
132 Returns TRUE if the shift key was down at the time of the key event.