File: classwx_keyboard_state.html

package info (click to toggle)
wxpython3.0 3.0.2.0%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 482,760 kB
  • ctags: 518,293
  • sloc: cpp: 2,127,226; python: 294,045; makefile: 51,942; ansic: 19,033; sh: 3,013; xml: 1,629; perl: 17
file content (430 lines) | stat: -rw-r--r-- 27,897 bytes parent folder | download | duplicates (2)
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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>wxWidgets: wxKeyboardState Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="extra_stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="page_container">
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0" style="width: 100%;">
 <tbody>
 <tr>
  <td id="projectlogo">
    <a href="http://www.wxwidgets.org/" target="_new">
      <img alt="wxWidgets" src="logo.png"/>
    </a>
  </td>
  <td style="padding-left: 0.5em; text-align: right;">
   <span id="projectnumber">Version: 3.0.2</span>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- Generated by Doxygen 1.8.2 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Categories</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classwx_keyboard_state-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">wxKeyboardState Class Reference<div class="ingroups"><a class="el" href="group__group__class__events.html">Events</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;wx/kbdstate.h&gt;</code></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for wxKeyboardState:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><img src="classwx_keyboard_state__inherit__graph.png" border="0" usemap="#wx_keyboard_state_inherit__map" alt="Inheritance graph"/></div>
<map name="wx_keyboard_state_inherit__map" id="wx_keyboard_state_inherit__map">
<area shape="rect" id="node3" href="classwx_key_event.html" title="This event class contains information about key press and release events." alt="" coords="5,83,96,111"/><area shape="rect" id="node5" href="classwx_mouse_state.html" title="Represents the mouse state." alt="" coords="120,83,227,111"/><area shape="rect" id="node7" href="classwx_mouse_event.html" title="This event class contains information about the events generated by the mouse: they include mouse but..." alt="" coords="120,161,227,189"/></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Provides methods for testing the state of the keyboard modifier keys. </p>
<p>This class is used as a base class of <a class="el" href="classwx_key_event.html" title="This event class contains information about key press and release events.">wxKeyEvent</a> and <a class="el" href="classwx_mouse_state.html" title="Represents the mouse state.">wxMouseState</a> and, hence, indirectly, of <a class="el" href="classwx_mouse_event.html" title="This event class contains information about the events generated by the mouse: they include mouse but...">wxMouseEvent</a>, so its methods may be used to get information about the modifier keys which were pressed when the event occurred.</p>
<p>This class is implemented entirely inline in &lt;<a class="el" href="kbdstate_8h.html">wx/kbdstate.h</a>&gt; and thus has no linking requirements.</p>
<h2></h2>
<div><span class="lib">Library:</span>&#160;&#160;<span class="lib_text">None; this class implementation is entirely header-based.</span></div><div><span class="category">Category:</span>&#160;&#160;<span class="category_text"><a class="el" href="group__group__class__events.html">Events</a></span></div><dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_key_event.html" title="This event class contains information about key press and release events.">wxKeyEvent</a>, <a class="el" href="classwx_mouse_state.html" title="Represents the mouse state.">wxMouseState</a> </dd></dl>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:aabf0c85adc4d56ca6364694eb26e55a8"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_keyboard_state.html#aabf0c85adc4d56ca6364694eb26e55a8">wxKeyboardState</a> (bool controlDown=false, bool shiftDown=false, bool altDown=false, bool metaDown=false)</td></tr>
<tr class="memdesc:aabf0c85adc4d56ca6364694eb26e55a8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor initializes the modifier key settings.  <a href="#aabf0c85adc4d56ca6364694eb26e55a8"></a><br/></td></tr>
<tr class="separator:aabf0c85adc4d56ca6364694eb26e55a8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a44b1e849563ebf43e073915a447e4aa5"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_keyboard_state.html#a44b1e849563ebf43e073915a447e4aa5">GetModifiers</a> () const </td></tr>
<tr class="memdesc:a44b1e849563ebf43e073915a447e4aa5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the bit mask of all pressed modifier keys.  <a href="#a44b1e849563ebf43e073915a447e4aa5"></a><br/></td></tr>
<tr class="separator:a44b1e849563ebf43e073915a447e4aa5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5a25ea99b0e7d1e8325cbe39c931e367"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_keyboard_state.html#a5a25ea99b0e7d1e8325cbe39c931e367">HasAnyModifiers</a> () const </td></tr>
<tr class="memdesc:a5a25ea99b0e7d1e8325cbe39c931e367"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if any modifiers at all are pressed.  <a href="#a5a25ea99b0e7d1e8325cbe39c931e367"></a><br/></td></tr>
<tr class="separator:a5a25ea99b0e7d1e8325cbe39c931e367"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a85ae7433cada04555d88704066a2f4fb"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_keyboard_state.html#a85ae7433cada04555d88704066a2f4fb">HasModifiers</a> () const </td></tr>
<tr class="memdesc:a85ae7433cada04555d88704066a2f4fb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if Control or Alt are pressed.  <a href="#a85ae7433cada04555d88704066a2f4fb"></a><br/></td></tr>
<tr class="separator:a85ae7433cada04555d88704066a2f4fb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae25436ceab56c88411dac479106b18dd"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_keyboard_state.html#ae25436ceab56c88411dac479106b18dd">ControlDown</a> () const </td></tr>
<tr class="memdesc:ae25436ceab56c88411dac479106b18dd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the Control key or Apple/Command key under OS X is pressed.  <a href="#ae25436ceab56c88411dac479106b18dd"></a><br/></td></tr>
<tr class="separator:ae25436ceab56c88411dac479106b18dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab0488a268111109cb6ff0ebd09e91ad1"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_keyboard_state.html#ab0488a268111109cb6ff0ebd09e91ad1">RawControlDown</a> () const </td></tr>
<tr class="memdesc:ab0488a268111109cb6ff0ebd09e91ad1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the Control key (also under OS X).  <a href="#ab0488a268111109cb6ff0ebd09e91ad1"></a><br/></td></tr>
<tr class="separator:ab0488a268111109cb6ff0ebd09e91ad1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a63b9ec3a2f30011471a7036853fc38f3"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_keyboard_state.html#a63b9ec3a2f30011471a7036853fc38f3">ShiftDown</a> () const </td></tr>
<tr class="memdesc:a63b9ec3a2f30011471a7036853fc38f3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the Shift key is pressed.  <a href="#a63b9ec3a2f30011471a7036853fc38f3"></a><br/></td></tr>
<tr class="separator:a63b9ec3a2f30011471a7036853fc38f3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8875366f7792d7fd5308cc240f5f0c5f"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_keyboard_state.html#a8875366f7792d7fd5308cc240f5f0c5f">MetaDown</a> () const </td></tr>
<tr class="memdesc:a8875366f7792d7fd5308cc240f5f0c5f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the Meta/Windows/Apple key is pressed.  <a href="#a8875366f7792d7fd5308cc240f5f0c5f"></a><br/></td></tr>
<tr class="separator:a8875366f7792d7fd5308cc240f5f0c5f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af71012a9fdbd32bbdc391c984ec5a588"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_keyboard_state.html#af71012a9fdbd32bbdc391c984ec5a588">AltDown</a> () const </td></tr>
<tr class="memdesc:af71012a9fdbd32bbdc391c984ec5a588"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the Alt key is pressed.  <a href="#af71012a9fdbd32bbdc391c984ec5a588"></a><br/></td></tr>
<tr class="separator:af71012a9fdbd32bbdc391c984ec5a588"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a05240fdaf0b5cc9db5f8207d0b8062de"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_keyboard_state.html#a05240fdaf0b5cc9db5f8207d0b8062de">CmdDown</a> () const </td></tr>
<tr class="memdesc:a05240fdaf0b5cc9db5f8207d0b8062de"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the key used for command accelerators is pressed.  <a href="#a05240fdaf0b5cc9db5f8207d0b8062de"></a><br/></td></tr>
<tr class="separator:a05240fdaf0b5cc9db5f8207d0b8062de"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac9e9f195b68f79f4aac683bb7eb620dd"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_keyboard_state.html#ac9e9f195b68f79f4aac683bb7eb620dd">SetControlDown</a> (bool down)</td></tr>
<tr class="separator:ac9e9f195b68f79f4aac683bb7eb620dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3a200bfbfaa31597f791e5bd57b99db6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_keyboard_state.html#a3a200bfbfaa31597f791e5bd57b99db6">SetRawControlDown</a> (bool down)</td></tr>
<tr class="separator:a3a200bfbfaa31597f791e5bd57b99db6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5a8f8337c65248310363aedf228303e9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_keyboard_state.html#a5a8f8337c65248310363aedf228303e9">SetShiftDown</a> (bool down)</td></tr>
<tr class="separator:a5a8f8337c65248310363aedf228303e9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6ba12f87c2c95364528ab152fa813de0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_keyboard_state.html#a6ba12f87c2c95364528ab152fa813de0">SetAltDown</a> (bool down)</td></tr>
<tr class="separator:a6ba12f87c2c95364528ab152fa813de0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adb5578cce4dce054cd24c7eb3cd650e7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_keyboard_state.html#adb5578cce4dce054cd24c7eb3cd650e7">SetMetaDown</a> (bool down)</td></tr>
<tr class="separator:adb5578cce4dce054cd24c7eb3cd650e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="aabf0c85adc4d56ca6364694eb26e55a8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">wxKeyboardState::wxKeyboardState </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>controlDown</em> = <code>false</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>shiftDown</em> = <code>false</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>altDown</em> = <code>false</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>metaDown</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constructor initializes the modifier key settings. </p>
<p>By default, no modifiers are active. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="af71012a9fdbd32bbdc391c984ec5a588"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool wxKeyboardState::AltDown </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns true if the Alt key is pressed. </p>
<p>Notice that <a class="el" href="classwx_keyboard_state.html#a44b1e849563ebf43e073915a447e4aa5" title="Return the bit mask of all pressed modifier keys.">GetModifiers()</a> should usually be used instead of this one. </p>

</div>
</div>
<a class="anchor" id="a05240fdaf0b5cc9db5f8207d0b8062de"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool wxKeyboardState::CmdDown </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns true if the key used for command accelerators is pressed. </p>
<p>Same as <a class="el" href="classwx_keyboard_state.html#ae25436ceab56c88411dac479106b18dd" title="Returns true if the Control key or Apple/Command key under OS X is pressed.">ControlDown()</a>. Deprecated.</p>
<p>Notice that <a class="el" href="classwx_keyboard_state.html#a44b1e849563ebf43e073915a447e4aa5" title="Return the bit mask of all pressed modifier keys.">GetModifiers()</a> should usually be used instead of this one. </p>

</div>
</div>
<a class="anchor" id="ae25436ceab56c88411dac479106b18dd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool wxKeyboardState::ControlDown </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns true if the Control key or Apple/Command key under OS X is pressed. </p>
<p>This function doesn't distinguish between right and left control keys.</p>
<p>Notice that <a class="el" href="classwx_keyboard_state.html#a44b1e849563ebf43e073915a447e4aa5" title="Return the bit mask of all pressed modifier keys.">GetModifiers()</a> should usually be used instead of this one. </p>

</div>
</div>
<a class="anchor" id="a44b1e849563ebf43e073915a447e4aa5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int wxKeyboardState::GetModifiers </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return the bit mask of all pressed modifier keys. </p>
<p>The return value is a combination of <code>wxMOD_ALT</code>, <code>wxMOD_CONTROL</code>, <code>wxMOD_SHIFT</code> and <code>wxMOD_META</code> bit masks. Additionally, <code>wxMOD_NONE</code> is defined as 0, i.e. corresponds to no modifiers (see <a class="el" href="classwx_keyboard_state.html#a5a25ea99b0e7d1e8325cbe39c931e367" title="Returns true if any modifiers at all are pressed.">HasAnyModifiers()</a>) and <code>wxMOD_CMD</code> is either <code>wxMOD_CONTROL</code> (MSW and Unix) or <code>wxMOD_META</code> (Mac), see <a class="el" href="classwx_keyboard_state.html#a05240fdaf0b5cc9db5f8207d0b8062de" title="Returns true if the key used for command accelerators is pressed.">CmdDown()</a>. See <a class="el" href="defs_8h.html#a5b81968ab866f5874cabc504490ae5cd" title="This enum contains bit mask constants used in wxKeyEvent.">wxKeyModifier</a> for the full list of modifiers.</p>
<p>Notice that this function is easier to use correctly than, for example, <a class="el" href="classwx_keyboard_state.html#ae25436ceab56c88411dac479106b18dd" title="Returns true if the Control key or Apple/Command key under OS X is pressed.">ControlDown()</a> because when using the latter you also have to remember to test that none of the other modifiers is pressed:</p>
<div class="fragment"><div class="line"><span class="keywordflow">if</span> ( <a class="code" href="classwx_keyboard_state.html#ae25436ceab56c88411dac479106b18dd" title="Returns true if the Control key or Apple/Command key under OS X is pressed.">ControlDown</a>() &amp;&amp; !<a class="code" href="classwx_keyboard_state.html#af71012a9fdbd32bbdc391c984ec5a588" title="Returns true if the Alt key is pressed.">AltDown</a>() &amp;&amp; !<a class="code" href="classwx_keyboard_state.html#a63b9ec3a2f30011471a7036853fc38f3" title="Returns true if the Shift key is pressed.">ShiftDown</a>() &amp;&amp; !<a class="code" href="classwx_keyboard_state.html#a8875366f7792d7fd5308cc240f5f0c5f" title="Returns true if the Meta/Windows/Apple key is pressed.">MetaDown</a>() )</div>
<div class="line">    ... handle Ctrl-XXX ...</div>
</div><!-- fragment --><p>and forgetting to do it can result in serious program bugs (e.g. program not working with European keyboard layout where <code>AltGr</code> key which is seen by the program as combination of CTRL and ALT is used). On the other hand, you can simply write:</p>
<div class="fragment"><div class="line"><span class="keywordflow">if</span> ( <a class="code" href="classwx_keyboard_state.html#a44b1e849563ebf43e073915a447e4aa5" title="Return the bit mask of all pressed modifier keys.">GetModifiers</a>() == <a class="code" href="defs_8h.html#a5b81968ab866f5874cabc504490ae5cda08db85848fe8fa43b85ba115050384db" title="Ctlr Key, corresponds to Command key on OS X.">wxMOD_CONTROL</a> )</div>
<div class="line">    ... handle Ctrl-XXX ...</div>
</div><!-- fragment --><p>with this function. </p>

</div>
</div>
<a class="anchor" id="a5a25ea99b0e7d1e8325cbe39c931e367"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool wxKeyboardState::HasAnyModifiers </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns true if any modifiers at all are pressed. </p>
<p>This is equivalent to <code><a class="el" href="classwx_keyboard_state.html#a44b1e849563ebf43e073915a447e4aa5" title="Return the bit mask of all pressed modifier keys.">GetModifiers()</a></code> <code>!=</code> <code>wxMOD_NONE</code>.</p>
<p>Notice that this is different from <a class="el" href="classwx_keyboard_state.html#a85ae7433cada04555d88704066a2f4fb" title="Returns true if Control or Alt are pressed.">HasModifiers()</a> method which doesn't take e.g. Shift modifier into account. This method is most suitable for mouse events when any modifier, including Shift, can change the interpretation of the event.</p>
<dl class="section since"><dt>Since</dt><dd>2.9.5 </dd></dl>

</div>
</div>
<a class="anchor" id="a85ae7433cada04555d88704066a2f4fb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool wxKeyboardState::HasModifiers </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns true if Control or Alt are pressed. </p>
<p>Checks if Control, Alt or, under OS X only, Command key are pressed (notice that the real Control key is still taken into account under OS X too).</p>
<p>This method returns <span class="literal">false</span> if only Shift is pressed for compatibility reasons and also because pressing Shift usually doesn't change the interpretation of key events, see <a class="el" href="classwx_keyboard_state.html#a5a25ea99b0e7d1e8325cbe39c931e367" title="Returns true if any modifiers at all are pressed.">HasAnyModifiers()</a> if you want to take Shift into account as well. </p>

</div>
</div>
<a class="anchor" id="a8875366f7792d7fd5308cc240f5f0c5f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool wxKeyboardState::MetaDown </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns true if the Meta/Windows/Apple key is pressed. </p>
<p>This function tests the state of the key traditionally called Meta under Unix systems, Windows keys under MSW Notice that <a class="el" href="classwx_keyboard_state.html#a44b1e849563ebf43e073915a447e4aa5" title="Return the bit mask of all pressed modifier keys.">GetModifiers()</a> should usually be used instead of this one.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_keyboard_state.html#a05240fdaf0b5cc9db5f8207d0b8062de" title="Returns true if the key used for command accelerators is pressed.">CmdDown()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ab0488a268111109cb6ff0ebd09e91ad1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool wxKeyboardState::RawControlDown </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns true if the Control key (also under OS X). </p>
<p>This function doesn't distinguish between right and left control keys.</p>
<p>Notice that <a class="el" href="classwx_keyboard_state.html#a44b1e849563ebf43e073915a447e4aa5" title="Return the bit mask of all pressed modifier keys.">GetModifiers()</a> should usually be used instead of this one. </p>

</div>
</div>
<a class="anchor" id="a6ba12f87c2c95364528ab152fa813de0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void wxKeyboardState::SetAltDown </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>down</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="ac9e9f195b68f79f4aac683bb7eb620dd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void wxKeyboardState::SetControlDown </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>down</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="adb5578cce4dce054cd24c7eb3cd650e7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void wxKeyboardState::SetMetaDown </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>down</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a3a200bfbfaa31597f791e5bd57b99db6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void wxKeyboardState::SetRawControlDown </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>down</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a5a8f8337c65248310363aedf228303e9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void wxKeyboardState::SetShiftDown </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>down</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a63b9ec3a2f30011471a7036853fc38f3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool wxKeyboardState::ShiftDown </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns true if the Shift key is pressed. </p>
<p>This function doesn't distinguish between right and left shift keys.</p>
<p>Notice that <a class="el" href="classwx_keyboard_state.html#a44b1e849563ebf43e073915a447e4aa5" title="Return the bit mask of all pressed modifier keys.">GetModifiers()</a> should usually be used instead of this one. </p>

</div>
</div>
</div><!-- contents -->

<address class="footer">
	<small>
		Generated on Thu Nov 27 2014 13:46:50 for wxWidgets by <a href="http://www.doxygen.org/index.html" target="_new">Doxygen</a> 1.8.2
	</small>
</address>
<script src="wxwidgets.js" type="text/javascript"></script>
</div><!-- #page_container -->
</body>
</html>