1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208
|
<HTML>
<head><title>wxKeyEvent</title></head>
<BODY BGCOLOR=#FFFFFF>
<A NAME="wxkeyevent"></A><CENTER>
<A HREF="wx.htm"><img align=center src="contents.gif" BORDER=0 ALT="Contents"></A> <A HREF="wx22.htm#classref"><img align=center src="up.gif" BORDER=0 ALT="Up"></A> <A HREF="wx123.htm#wxjoystickevent"><img align=center src="back.gif" BORDER=0 ALT="Previous"></A> <A HREF="wx125.htm#wxlayoutalgorithm"><img align=center src="forward.gif" BORDER=0 ALT="Next"></A> </CENTER><HR>
<H2>wxKeyEvent</H2>
<P>
This event class contains information about keypress (character) events.<P>
<B><FONT COLOR="#FF0000">Derived from</FONT></B><P>
<A HREF="wx84.htm#wxevent">wxEvent</A><P>
<B><FONT COLOR="#FF0000">Include files</FONT></B><P>
<wx/event.h><P>
<B><FONT COLOR="#FF0000">Event table macros</FONT></B><P>
To process a key event, use these event handler macros to direct input to member
functions that take a wxKeyEvent argument.<P>
<TABLE>
<TR><TD VALIGN=TOP>
<B>EVT_CHAR(func)</B>
</TD>
<TD VALIGN=TOP>
Process a wxEVT_CHAR event (a non-modifier key has been pressed).
</TD></TR>
<TR><TD VALIGN=TOP>
<B>EVT_KEY_DOWN(func)</B>
</TD>
<TD VALIGN=TOP>
Process a wxEVT_KEY_DOWN event (any key has been pressed).
</TD></TR>
<TR><TD VALIGN=TOP>
<B>EVT_KEY_UP(func)</B>
</TD>
<TD VALIGN=TOP>
Process a wxEVT_KEY_UP event (any key has been released).
</TD></TR>
<TR><TD VALIGN=TOP>
<B>EVT_CHAR(func)</B>
</TD>
<TD VALIGN=TOP>
Process a wxEVT_CHAR event.
</TD></TR>
<TR><TD VALIGN=TOP>
<B>EVT_CHAR_HOOK(func)</B>
</TD>
<TD VALIGN=TOP>
Process a wxEVT_CHAR_HOOK event.
</TD></TR>
</TABLE>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx260.htm#wxwindowonchar">wxWindow::OnChar</A>,
<A HREF="wx260.htm#wxwindowoncharhook">wxWindow::OnCharHook</A>,
<A HREF="wx260.htm#wxwindowonkeydown">wxWindow::OnKeyDown</A>,
<A HREF="wx260.htm#wxwindowonkeyup">wxWindow::OnKeyUp</A><P>
<B><FONT COLOR="#FF0000">Members</FONT></B><P>
<A HREF="#topic495">wxKeyEvent::m_altDown</A><BR>
<A HREF="#topic496">wxKeyEvent::m_controlDown</A><BR>
<A HREF="#topic497">wxKeyEvent::m_keyCode</A><BR>
<A HREF="#topic498">wxKeyEvent::m_metaDown</A><BR>
<A HREF="#topic499">wxKeyEvent::m_shiftDown</A><BR>
<A HREF="#topic500">wxKeyEvent::m_x</A><BR>
<A HREF="#topic501">wxKeyEvent::m_y</A><BR>
<A HREF="#topic502">wxKeyEvent::wxKeyEvent</A><BR>
<A HREF="#topic503">wxKeyEvent::AltDown</A><BR>
<A HREF="#topic504">wxKeyEvent::ControlDown</A><BR>
<A HREF="#topic505">wxKeyEvent::GetX</A><BR>
<A HREF="#topic506">wxKeyEvent::GetY</A><BR>
<A HREF="#topic507">wxKeyEvent::KeyCode</A><BR>
<A HREF="#topic508">wxKeyEvent::MetaDown</A><BR>
<A HREF="#topic509">wxKeyEvent::Position</A><BR>
<A HREF="#topic510">wxKeyEvent::ShiftDown</A><BR>
<P>
<HR>
<A NAME="topic495"></A>
<H3>wxKeyEvent::m_altDown</H3>
<P>
bool m_altDown<P>
TRUE if the Alt key is pressed down.<P>
<HR>
<A NAME="topic496"></A>
<H3>wxKeyEvent::m_controlDown</H3>
<P>
bool m_controlDown<P>
TRUE if control is pressed down.<P>
<HR>
<A NAME="topic497"></A>
<H3>wxKeyEvent::m_keyCode</H3>
<P>
long m_keyCode<P>
Virtual keycode. See <A HREF="wx276.htm#keycodes">Keycodes</A> for a list of identifiers.<P>
<HR>
<A NAME="topic498"></A>
<H3>wxKeyEvent::m_metaDown</H3>
<P>
bool m_metaDown<P>
TRUE if the Meta key is pressed down.<P>
<HR>
<A NAME="topic499"></A>
<H3>wxKeyEvent::m_shiftDown</H3>
<P>
bool m_shiftDown<P>
TRUE if shift is pressed down.<P>
<HR>
<A NAME="topic500"></A>
<H3>wxKeyEvent::m_x</H3>
<P>
int m_x<P>
X position of the event.<P>
<HR>
<A NAME="topic501"></A>
<H3>wxKeyEvent::m_y</H3>
<P>
int m_y<P>
Y position of the event.<P>
<HR>
<A NAME="topic502"></A>
<H3>wxKeyEvent::wxKeyEvent</H3>
<P>
<B></B> <B>wxKeyEvent</B>(<B>WXTYPE</B><I> keyEventType</I>)<P>
Constructor. Currently, the only valid event types are wxEVT_CHAR and wxEVT_CHAR_HOOK.<P>
<HR>
<A NAME="topic503"></A>
<H3>wxKeyEvent::AltDown</H3>
<P>
<B>bool</B> <B>AltDown</B>()<P>
Returns TRUE if the Alt key was down at the time of the key event.<P>
<HR>
<A NAME="topic504"></A>
<H3>wxKeyEvent::ControlDown</H3>
<P>
<B>bool</B> <B>ControlDown</B>()<P>
Returns TRUE if the control key was down at the time of the key event.<P>
<HR>
<A NAME="topic505"></A>
<H3>wxKeyEvent::GetX</H3>
<P>
<B>float</B> <B>GetX</B>()<P>
Returns the X position of the event.<P>
<HR>
<A NAME="topic506"></A>
<H3>wxKeyEvent::GetY</H3>
<P>
<B>float</B> <B>GetY</B>()<P>
Returns the Y position of the event.<P>
<HR>
<A NAME="topic507"></A>
<H3>wxKeyEvent::KeyCode</H3>
<P>
<B>long</B> <B>KeyCode</B>()<P>
Returns the virtual key code. ASCII events return normal ASCII values,
while non-ASCII events return values such as <B>WXK_LEFT</B> for the
left cursor key. See <A HREF="wx276.htm#keycodes">Keycodes</A> for a full list of the virtual key codes.<P>
<HR>
<A NAME="topic508"></A>
<H3>wxKeyEvent::MetaDown</H3>
<P>
<B>bool</B> <B>MetaDown</B>()<P>
Returns TRUE if the Meta key was down at the time of the key event.<P>
<HR>
<A NAME="topic509"></A>
<H3>wxKeyEvent::Position</H3>
<P>
<B>void</B> <B>Position</B>(<B>float *</B><I>x</I>, <B>float *</B><I>y</I>)<P>
Obtains the position at which the key was pressed.<P>
<HR>
<A NAME="topic510"></A>
<H3>wxKeyEvent::ShiftDown</H3>
<P>
<B>bool</B> <B>ShiftDown</B>()<P>
Returns TRUE if the shift key was down at the time of the key event.<P>
</BODY></HTML>
|