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{Event table macros
}
11 To process a key event, use these event handler macros to direct input to member
12 functions that take a wxKeyEvent argument.
15 \begin{twocollist
}\itemsep=
0pt
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).
}
19 \twocolitem{{\bf EVT
\_CHAR(func)
}}{Process a wxEVT
\_CHAR event.
}
20 \twocolitem{{\bf EVT
\_CHAR\_HOOK(func)
}}{Process a wxEVT
\_CHAR\_HOOK event.
}
25 \helpref{wxWindow::OnChar
}{wxwindowonchar
},
26 \helpref{wxWindow::OnCharHook
}{wxwindowoncharhook
},
27 \helpref{wxWindow::OnKeyDown
}{wxwindowonkeydown
},
28 \helpref{wxWindow::OnKeyUp
}{wxwindowonkeyup
}
30 \latexignore{\rtfignore{\wxheading{Members
}}}
32 \membersection{wxKeyEvent::m
\_altDown}
34 \member{bool
}{m
\_altDown}
36 TRUE if the Alt key is pressed down.
38 \membersection{wxKeyEvent::m
\_controlDown}
40 \member{bool
}{m
\_controlDown}
42 TRUE if control is pressed down.
44 \membersection{wxKeyEvent::m
\_keyCode}
46 \member{long
}{m
\_keyCode}
48 Virtual keycode. See
\helpref{Keycodes
}{keycodes
} for a list of identifiers.
50 \membersection{wxKeyEvent::m
\_metaDown}
52 \member{bool
}{m
\_metaDown}
54 TRUE if the Meta key is pressed down.
56 \membersection{wxKeyEvent::m
\_shiftDown}
58 \member{bool
}{m
\_shiftDown}
60 TRUE if shift is pressed down.
62 \membersection{wxKeyEvent::m
\_x}
66 X position of the event.
68 \membersection{wxKeyEvent::m
\_y}
72 Y position of the event.
74 \membersection{wxKeyEvent::wxKeyEvent
}
76 \func{}{wxKeyEvent
}{\param{WXTYPE
}{ keyEventType
}}
78 Constructor. Currently, the only valid event types are wxEVT
\_CHAR and wxEVT
\_CHAR\_HOOK.
80 \membersection{wxKeyEvent::AltDown
}
82 \func{bool
}{AltDown
}{\void}
84 Returns TRUE if the Alt key was down at the time of the key event.
86 \membersection{wxKeyEvent::ControlDown
}
88 \func{bool
}{ControlDown
}{\void}
90 Returns TRUE if the control key was down at the time of the key event.
92 \membersection{wxKeyEvent::GetX
}
94 \func{float
}{GetX
}{\void}
96 Returns the X position of the event.
98 \membersection{wxKeyEvent::GetY
}
100 \func{float
}{GetY
}{\void}
102 Returns the Y position of the event.
104 \membersection{wxKeyEvent::KeyCode
}
106 \func{long
}{KeyCode
}{\void}
108 Returns the virtual key code. ASCII events return normal ASCII values,
109 while non-ASCII events return values such as
{\bf WXK
\_LEFT} for the
110 left cursor key. See
\helpref{Keycodes
}{keycodes
} for a full list of the virtual key codes.
112 \membersection{wxKeyEvent::MetaDown
}
114 \func{bool
}{MetaDown
}{\void}
116 Returns TRUE if the Meta key was down at the time of the key event.
118 \membersection{wxKeyEvent::Position
}
120 \func{void
}{Position
}{\param{float *
}{x
},
\param{float *
}{y
}}
122 Obtains the position at which the key was pressed.
124 \membersection{wxKeyEvent::ShiftDown
}
126 \func{bool
}{ShiftDown
}{\void}
128 Returns TRUE if the shift key was down at the time of the key event.