]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/keyevent.tex
Fixed DLL linking. Was missing the regex lib.
[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
954b8ae6
JS
9\wxheading{Include files}
10
11<wx/event.h>
12
a660d684
KB
13\wxheading{Event table macros}
14
15To process a key event, use these event handler macros to direct input to member
16functions that take a wxKeyEvent argument.
17
18\twocolwidtha{7cm}
19\begin{twocollist}\itemsep=0pt
818e52c2 20\twocolitem{{\bf EVT\_CHAR(func)}}{Process a wxEVT\_CHAR event (a non-modifier key has been pressed).}
4ce81a75
JS
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).}
a660d684
KB
23\twocolitem{{\bf EVT\_CHAR(func)}}{Process a wxEVT\_CHAR event.}
24\twocolitem{{\bf EVT\_CHAR\_HOOK(func)}}{Process a wxEVT\_CHAR\_HOOK event.}
25\end{twocollist}%
26
4ce81a75
JS
27\wxheading{See also}
28
29\helpref{wxWindow::OnChar}{wxwindowonchar},
30\helpref{wxWindow::OnCharHook}{wxwindowoncharhook},
31\helpref{wxWindow::OnKeyDown}{wxwindowonkeydown},
32\helpref{wxWindow::OnKeyUp}{wxwindowonkeyup}
33
a660d684
KB
34\latexignore{\rtfignore{\wxheading{Members}}}
35
36\membersection{wxKeyEvent::m\_altDown}
37
38\member{bool}{m\_altDown}
39
40TRUE if the Alt key is pressed down.
41
42\membersection{wxKeyEvent::m\_controlDown}
43
44\member{bool}{m\_controlDown}
45
46TRUE if control is pressed down.
47
48\membersection{wxKeyEvent::m\_keyCode}
49
50\member{long}{m\_keyCode}
51
3972fb49 52Virtual keycode. See \helpref{Keycodes}{keycodes} for a list of identifiers.
a660d684
KB
53
54\membersection{wxKeyEvent::m\_metaDown}
55
56\member{bool}{m\_metaDown}
57
58TRUE if the Meta key is pressed down.
59
60\membersection{wxKeyEvent::m\_shiftDown}
61
62\member{bool}{m\_shiftDown}
63
64TRUE if shift is pressed down.
65
66\membersection{wxKeyEvent::m\_x}
67
68\member{int}{m\_x}
69
70X position of the event.
71
72\membersection{wxKeyEvent::m\_y}
73
74\member{int}{m\_y}
75
76Y position of the event.
77
78\membersection{wxKeyEvent::wxKeyEvent}
79
80\func{}{wxKeyEvent}{\param{WXTYPE}{ keyEventType}}
81
82Constructor. Currently, the only valid event types are wxEVT\_CHAR and wxEVT\_CHAR\_HOOK.
83
84\membersection{wxKeyEvent::AltDown}
85
803ef874 86\constfunc{bool}{AltDown}{\void}
a660d684
KB
87
88Returns TRUE if the Alt key was down at the time of the key event.
89
90\membersection{wxKeyEvent::ControlDown}
91
803ef874 92\constfunc{bool}{ControlDown}{\void}
a660d684
KB
93
94Returns TRUE if the control key was down at the time of the key event.
95
f6bcfd97
BP
96\membersection{wxKeyEvent::GetKeyCode}
97
98\constfunc{int}{GetKeyCode}{\void}
99
100Returns the virtual key code. ASCII events return normal ASCII values,
101while non-ASCII events return values such as {\bf WXK\_LEFT} for the
102left cursor key. See \helpref{Keycodes}{keycodes} for a full list of the virtual key codes.
103
a660d684
KB
104\membersection{wxKeyEvent::GetX}
105
803ef874 106\constfunc{long}{GetX}{\void}
a660d684
KB
107
108Returns the X position of the event.
109
110\membersection{wxKeyEvent::GetY}
111
803ef874 112\constfunc{long}{GetY}{\void}
a660d684
KB
113
114Returns the Y position of the event.
115
a660d684
KB
116\membersection{wxKeyEvent::MetaDown}
117
803ef874 118\constfunc{bool}{MetaDown}{\void}
a660d684
KB
119
120Returns TRUE if the Meta key was down at the time of the key event.
121
803ef874 122\membersection{wxKeyEvent::GetPosition}
a660d684 123
803ef874
JS
124\constfunc{wxPoint}{GetPosition}{\void}
125
126\constfunc{void}{GetPosition}{\param{long *}{x}, \param{long *}{y}}
a660d684
KB
127
128Obtains the position at which the key was pressed.
129
f6bcfd97
BP
130\membersection{wxKeyEvent::HasModifiers}
131
132\constfunc{bool}{HasModifiers}{\void}
133
d11710cb 134Returns TRUE if either {\sc Ctrl} or {\sc Alt} keys was down
f6bcfd97 135at the time of the key event. Note that this function does not take into
d11710cb
VZ
136account neither {\sc Shift} nor {\sc Meta} key states (the reason for ignoring
137the latter is that it is common for {\sc NumLock} key to be configured as
138{\sc Meta} under X but the key presses even while {\sc NumLock} is on should
139be still processed normally).
f6bcfd97 140
a660d684
KB
141\membersection{wxKeyEvent::ShiftDown}
142
803ef874 143\constfunc{bool}{ShiftDown}{\void}
a660d684
KB
144
145Returns TRUE if the shift key was down at the time of the key event.
146
147