]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/keyevent.tex
a bit more docs
[wxWidgets.git] / docs / latex / wx / keyevent.tex
CommitLineData
a660d684
KB
1\section{\class{wxKeyEvent}}\label{wxkeyevent}
2
4ce81a75 3This event class contains information about keypress (character) events.
a660d684
KB
4
5\wxheading{Derived from}
6
7\helpref{wxEvent}{wxevent}
8
9\wxheading{Event table macros}
10
11To process a key event, use these event handler macros to direct input to member
12functions that take a wxKeyEvent argument.
13
14\twocolwidtha{7cm}
15\begin{twocollist}\itemsep=0pt
4ce81a75
JS
16\twocolitem{{\bf EVT\_CHAR(func)}}{Process a wxEVT\_CHAR event (an ASCII key has been pressed).}
17\twocolitem{{\bf EVT\_KEY\_DOWN(func)}}{Process a wxEVT\_KEY\_DOWN event (any key has been pressed).}
18\twocolitem{{\bf EVT\_KEY\_UP(func)}}{Process a wxEVT\_KEY\_UP event (any key has been released).}
a660d684
KB
19\twocolitem{{\bf EVT\_CHAR(func)}}{Process a wxEVT\_CHAR event.}
20\twocolitem{{\bf EVT\_CHAR\_HOOK(func)}}{Process a wxEVT\_CHAR\_HOOK event.}
21\end{twocollist}%
22
4ce81a75
JS
23\wxheading{See also}
24
25\helpref{wxWindow::OnChar}{wxwindowonchar},
26\helpref{wxWindow::OnCharHook}{wxwindowoncharhook},
27\helpref{wxWindow::OnKeyDown}{wxwindowonkeydown},
28\helpref{wxWindow::OnKeyUp}{wxwindowonkeyup}
29
a660d684
KB
30\latexignore{\rtfignore{\wxheading{Members}}}
31
32\membersection{wxKeyEvent::m\_altDown}
33
34\member{bool}{m\_altDown}
35
36TRUE if the Alt key is pressed down.
37
38\membersection{wxKeyEvent::m\_controlDown}
39
40\member{bool}{m\_controlDown}
41
42TRUE if control is pressed down.
43
44\membersection{wxKeyEvent::m\_keyCode}
45
46\member{long}{m\_keyCode}
47
3972fb49 48Virtual keycode. See \helpref{Keycodes}{keycodes} for a list of identifiers.
a660d684
KB
49
50\membersection{wxKeyEvent::m\_metaDown}
51
52\member{bool}{m\_metaDown}
53
54TRUE if the Meta key is pressed down.
55
56\membersection{wxKeyEvent::m\_shiftDown}
57
58\member{bool}{m\_shiftDown}
59
60TRUE if shift is pressed down.
61
62\membersection{wxKeyEvent::m\_x}
63
64\member{int}{m\_x}
65
66X position of the event.
67
68\membersection{wxKeyEvent::m\_y}
69
70\member{int}{m\_y}
71
72Y position of the event.
73
74\membersection{wxKeyEvent::wxKeyEvent}
75
76\func{}{wxKeyEvent}{\param{WXTYPE}{ keyEventType}}
77
78Constructor. Currently, the only valid event types are wxEVT\_CHAR and wxEVT\_CHAR\_HOOK.
79
80\membersection{wxKeyEvent::AltDown}
81
82\func{bool}{AltDown}{\void}
83
84Returns TRUE if the Alt key was down at the time of the key event.
85
86\membersection{wxKeyEvent::ControlDown}
87
88\func{bool}{ControlDown}{\void}
89
90Returns TRUE if the control key was down at the time of the key event.
91
92\membersection{wxKeyEvent::GetX}
93
94\func{float}{GetX}{\void}
95
96Returns the X position of the event.
97
98\membersection{wxKeyEvent::GetY}
99
100\func{float}{GetY}{\void}
101
102Returns the Y position of the event.
103
104\membersection{wxKeyEvent::KeyCode}
105
106\func{long}{KeyCode}{\void}
107
108Returns the virtual key code. ASCII events return normal ASCII values,
109while non-ASCII events return values such as {\bf WXK\_LEFT} for the
3972fb49 110left cursor key. See \helpref{Keycodes}{keycodes} for a full list of the virtual key codes.
a660d684
KB
111
112\membersection{wxKeyEvent::MetaDown}
113
114\func{bool}{MetaDown}{\void}
115
116Returns TRUE if the Meta key was down at the time of the key event.
117
118\membersection{wxKeyEvent::Position}
119
120\func{void}{Position}{\param{float *}{x}, \param{float *}{y}}
121
122Obtains the position at which the key was pressed.
123
124\membersection{wxKeyEvent::ShiftDown}
125
126\func{bool}{ShiftDown}{\void}
127
128Returns TRUE if the shift key was down at the time of the key event.
129
130