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
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>NeL: NLMISC::CEventListenerAsync class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.6 -->
<div class="qindex"> <form class="search" action="search.php" method="get">
<a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a> | <span class="search"><u>S</u>earch for <input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div>
<h1>NLMISC::CEventListenerAsync Class Reference</h1><code>#include <<a class="el" href="a05685.html">event_listener.h</a>></code>
<p>
<p>Inheritance diagram for NLMISC::CEventListenerAsync:
<p><center><img src="a02472.png" usemap="#NLMISC::CEventListenerAsync_map" border="0" alt=""></center>
<map name="NLMISC::CEventListenerAsync_map">
<area href="a02464.html" alt="NLMISC::IEventListener" shape="rect" coords="0,0,187,24">
</map>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<a class="el" href="a02472.html">CEventListenerAsync</a> <dl compact><dt><b>Author:</b></dt><dd>Stephane Coutelas <p>
Nevrax France </dd></dl>
<dl compact><dt><b>Date:</b></dt><dd>2000 </dd></dl>
<p>
<p>
Definition at line <a class="el" href="a05685.html#l00066">66</a> of file <a class="el" href="a05685.html">event_listener.h</a>.<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02472.html#NLMISC_1_1CEventListenerAsynca0">addToServer</a> (<a class="el" href="a02479.html">CEventServer</a> &server)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a02472.html#NLMISC_1_1CEventListenerAsynca1">CEventListenerAsync</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#NLMISC_1_1CEventListenerAsynca1"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02472.html#NLMISC_1_1CEventListenerAsynca2">isKeyDown</a> (<a class="el" href="a05378.html#a442">TKey</a> key) const </td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02472.html#NLMISC_1_1CEventListenerAsynca3">isKeyPushed</a> (<a class="el" href="a05378.html#a442">TKey</a> key, bool release=true)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02472.html#NLMISC_1_1CEventListenerAsynca4">removeFromServer</a> (<a class="el" href="a02479.html">CEventServer</a> &server)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02472.html#NLMISC_1_1CEventListenerAsynca5">reset</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual </td><td class="memItemRight" valign=bottom><a class="el" href="a02472.html#NLMISC_1_1CEventListenerAsynca6">~CEventListenerAsync</a> ()</td></tr>
<tr><td colspan=2><br><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="a02472.html#NLMISC_1_1CEventListenerAsyncb0">operator()</a> (const <a class="el" href="a02461.html">CEvent</a> &event)</td></tr>
<tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02272.html">CBitSet</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02472.html#NLMISC_1_1CEventListenerAsyncp0">_KeyArray</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02272.html">CBitSet</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02472.html#NLMISC_1_1CEventListenerAsyncp1">_KeyDownArray</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02272.html">CBitSet</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02472.html#NLMISC_1_1CEventListenerAsyncp2">_KeyReleaseArray</a></td></tr>
</table>
<hr><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" name="NLMISC_1_1CEventListenerAsynca1" doxytag="NLMISC::CEventListenerAsync::CEventListenerAsync" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> NLMISC::CEventListenerAsync::CEventListenerAsync </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Constructor.
<p>
<p>
Definition at line <a class="el" href="a05684.html#l00050">50</a> of file <a class="el" href="a05684.html">event_listener.cpp</a>.
<p>
References <a class="el" href="a05685.html#l00118">_KeyArray</a>, <a class="el" href="a05685.html#l00120">_KeyDownArray</a>, <a class="el" href="a05685.html#l00120">_KeyReleaseArray</a>, <a class="el" href="a05378.html#a442a207">NLMISC::KeyCount</a>, <a class="el" href="a05684.html#l00195">reset()</a>, and <a class="el" href="a05484.html#l00081">NLMISC::CBitSet::resize()</a>.
<p>
<div class="fragment"><pre>00051 {
00052 <a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp0">_KeyArray</a>.resize (KeyCount);
00053 <a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp1">_KeyDownArray</a>.resize (KeyCount);
00054 <a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp2">_KeyReleaseArray</a>.resize (KeyCount);
00055 <a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsynca5">reset</a> ();
00056 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLMISC_1_1CEventListenerAsynca6" doxytag="NLMISC::CEventListenerAsync::~CEventListenerAsync" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> virtual NLMISC::CEventListenerAsync::~<a class="el" href="a02472.html">CEventListenerAsync</a> </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [inline, virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05685.html#l00072">72</a> of file <a class="el" href="a05685.html">event_listener.h</a>.
<p>
<div class="fragment"><pre>00072 {}
</pre></div> </td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="NLMISC_1_1CEventListenerAsynca0" doxytag="NLMISC::CEventListenerAsync::addToServer" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NLMISC::CEventListenerAsync::addToServer </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a02479.html">CEventServer</a> & </td>
<td class="mdname1" valign="top" nowrap> <em>server</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Register the listener to the server.
<p>
Definition at line <a class="el" href="a05684.html#l00058">58</a> of file <a class="el" href="a05684.html">event_listener.cpp</a>.
<p>
References <a class="el" href="a05688.html#l00105">NLMISC::CEventServer::addListener()</a>, <a class="el" href="a05378.html#a47">NLMISC::EventKeyDownId</a>, <a class="el" href="a05378.html#a48">NLMISC::EventKeyUpId</a>, and <a class="el" href="a05378.html#a51">NLMISC::EventSetFocusId</a>.
<p>
Referenced by <a class="el" href="a05686.html#l00323">NL3D::CEvent3dMouseListener::addToServer()</a>, and <a class="el" href="a05657.html#l00230">NL3D::CDriverUser::setDisplay()</a>.
<p>
<div class="fragment"><pre>00059 {
00060 server.addListener (EventKeyDownId, <span class="keyword">this</span>);
00061 server.addListener (EventSetFocusId, <span class="keyword">this</span>);
00062 server.addListener (EventKeyUpId, <span class="keyword">this</span>);
00063 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLMISC_1_1CEventListenerAsynca2" doxytag="NLMISC::CEventListenerAsync::isKeyDown" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool NLMISC::CEventListenerAsync::isKeyDown </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a05378.html#a442">TKey</a> </td>
<td class="mdname1" valign="top" nowrap> <em>key</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Get a key down instant state. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>key</em> </td><td>is the key to check.</td></tr>
</table>
</dl>
<p>
Definition at line <a class="el" href="a05684.html#l00072">72</a> of file <a class="el" href="a05684.html">event_listener.cpp</a>.
<p>
References <a class="el" href="a05685.html#l00118">_KeyArray</a>, and <a class="el" href="a05485.html#l00087">NLMISC::CBitSet::get()</a>.
<p>
Referenced by <a class="el" href="a05686.html#l00341">NL3D::CEvent3dMouseListener::getViewMatrix()</a>.
<p>
<div class="fragment"><pre>00073 {
00074 <span class="keywordflow">return</span> <a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp0">_KeyArray</a>.get(key);
00075 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLMISC_1_1CEventListenerAsynca3" doxytag="NLMISC::CEventListenerAsync::isKeyPushed" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool NLMISC::CEventListenerAsync::isKeyPushed </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a05378.html#a442">TKey</a> </td>
<td class="mdname" nowrap> <em>key</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>bool </td>
<td class="mdname" nowrap> <em>release</em> = true</td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Get if a the state of key has pushed since the last call of isKeyPushed with release=true. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>key</em> </td><td>is the key to check. </td></tr>
<tr><td valign=top><em>release</em> </td><td>if true, the pushed state of the key is released (force to be false). It will return to true next time only if key is released and then re-pushed. </td></tr>
</table>
</dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="a02472.html#NLMISC_1_1CEventListenerAsynca5">reset()</a></dd></dl>
<p>
Definition at line <a class="el" href="a05684.html#l00078">78</a> of file <a class="el" href="a05684.html">event_listener.cpp</a>.
<p>
References <a class="el" href="a05685.html#l00120">_KeyDownArray</a>, <a class="el" href="a05685.html#l00120">_KeyReleaseArray</a>, <a class="el" href="a05485.html#l00087">NLMISC::CBitSet::get()</a>, and <a class="el" href="a05485.html#l00075">NLMISC::CBitSet::set()</a>.
<p>
Referenced by <a class="el" href="a06092.html#l00192">NL3D::CNELU::screenshot()</a>.
<p>
<div class="fragment"><pre>00079 {
00080 <span class="keywordtype">bool</span> ret= <a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp1">_KeyDownArray</a>.get(key) && !(<a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp2">_KeyReleaseArray</a>.get(key));
00081 <span class="keywordflow">if</span>(ret && release)
00082 {
00083 <a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp2">_KeyReleaseArray</a>.set(key, <span class="keyword">true</span>);
00084 }
00085 <span class="keywordflow">return</span> ret;
00086 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLMISC_1_1CEventListenerAsyncb0" doxytag="NLMISC::CEventListenerAsync::operator()" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NLMISC::CEventListenerAsync::operator() </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const <a class="el" href="a02461.html">CEvent</a> & </td>
<td class="mdname1" valign="top" nowrap> <em>event</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [protected, virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Call back of the listener. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>event</em> </td><td>is the event send to the listener</td></tr>
</table>
</dl>
<p>
Implements <a class="el" href="a02464.html#NLMISC_1_1IEventListenera1">NLMISC::IEventListener</a>.
<p>
Definition at line <a class="el" href="a05684.html#l00089">89</a> of file <a class="el" href="a05684.html">event_listener.cpp</a>.
<p>
References <a class="el" href="a05685.html#l00118">_KeyArray</a>, <a class="el" href="a05685.html#l00120">_KeyDownArray</a>, <a class="el" href="a05685.html#l00120">_KeyReleaseArray</a>, <a class="el" href="a05484.html#l00075">NLMISC::CBitSet::clear()</a>, <a class="el" href="a05484.html#l00125">NLMISC::CBitSet::clearAll()</a>, <a class="el" href="a05378.html#a47">NLMISC::EventKeyDownId</a>, <a class="el" href="a05378.html#a48">NLMISC::EventKeyUpId</a>, <a class="el" href="a05378.html#a51">NLMISC::EventSetFocusId</a>, <a class="el" href="a05691.html#l00454">NLMISC::CEventSetFocus::Get</a>, <a class="el" href="a05485.html#l00087">NLMISC::CBitSet::get()</a>, <a class="el" href="a05691.html#l00301">NLMISC::CEventKeyUp::Key</a>, <a class="el" href="a05691.html#l00285">NLMISC::CEventKeyDown::Key</a>, <a class="el" href="a05378.html#a442a103">NLMISC::KeyCONTROL</a>, <a class="el" href="a05378.html#a442a182">NLMISC::KeyLCONTROL</a>, <a class="el" href="a05378.html#a442a184">NLMISC::KeyLMENU</a>, <a class="el" href="a05378.html#a442a180">NLMISC::KeyLSHIFT</a>, <a class="el" href="a05378.html#a442a104">NLMISC::KeyMENU</a>, <a class="el" href="a05378.html#a442a183">NLMISC::KeyRCONTROL</a>, <a class="el" href="a05378.html#a442a185">NLMISC::KeyRMENU</a>, <a class="el" href="a05378.html#a442a181">NLMISC::KeyRSHIFT</a>, <a class="el" href="a05378.html#a442a102">NLMISC::KeySHIFT</a>, and <a class="el" href="a05485.html#l00075">NLMISC::CBitSet::set()</a>.
<p>
<div class="fragment"><pre>00090 {
00091 <span class="comment">// Key down ?</span>
00092 <span class="keywordflow">if</span> (event==<a class="code" href="a05378.html#a47">EventKeyDownId</a>)
00093 {
00094 CEventKeyDown *pEvent=(CEventKeyDown*)&event;
00095 <a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp0">_KeyArray</a>.set (pEvent->Key);
00096 <a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp1">_KeyDownArray</a>.set (pEvent->Key);
00097 <span class="keywordflow">switch</span>(pEvent->Key)
00098 {
00099 <span class="keywordflow">case</span> <a class="code" href="a05378.html#a442a183">KeyRCONTROL</a>:
00100 <span class="keywordflow">case</span> <a class="code" href="a05378.html#a442a182">KeyLCONTROL</a>:
00101 <a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp0">_KeyArray</a>.set (KeyCONTROL);
00102 <a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp1">_KeyDownArray</a>.set (KeyCONTROL);
00103 <span class="keywordflow">break</span>;
00104 <span class="keywordflow">case</span> <a class="code" href="a05378.html#a442a181">KeyRSHIFT</a>:
00105 <span class="keywordflow">case</span> <a class="code" href="a05378.html#a442a180">KeyLSHIFT</a>:
00106 <a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp0">_KeyArray</a>.set (KeySHIFT);
00107 <a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp1">_KeyDownArray</a>.set (KeySHIFT);
00108 <span class="keywordflow">break</span>;
00109 <span class="keywordflow">case</span> <a class="code" href="a05378.html#a442a185">KeyRMENU</a>:
00110 <span class="keywordflow">case</span> <a class="code" href="a05378.html#a442a184">KeyLMENU</a>:
00111 <a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp0">_KeyArray</a>.set (KeyMENU);
00112 <a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp1">_KeyDownArray</a>.set (KeyMENU);
00113 <span class="keywordflow">break</span>;
00114 <span class="keywordflow">default</span>:
00115 <span class="keywordflow">break</span>;
00116 }
00117 }
00118 <span class="comment">// Key up ?</span>
00119 <span class="keywordflow">if</span> (event==<a class="code" href="a05378.html#a48">EventKeyUpId</a>)
00120 {
00121 CEventKeyUp *pEvent=(CEventKeyUp*)&event;
00122
00123 <a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp0">_KeyArray</a>.clear (pEvent->Key);
00124
00125 <span class="keywordflow">switch</span>(pEvent->Key)
00126 {
00127 <span class="keywordflow">case</span> <a class="code" href="a05378.html#a442a183">KeyRCONTROL</a>:
00128 <span class="keywordflow">case</span> <a class="code" href="a05378.html#a442a182">KeyLCONTROL</a>:
00129 <span class="comment">// Do not "raise up" the key, until someone has get the state of this key. </span>
00130 <span class="keywordflow">if</span> (!<a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp0">_KeyArray</a>[<a class="code" href="a05378.html#a442a182">KeyLCONTROL</a>] && !<a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp0">_KeyArray</a>[<a class="code" href="a05378.html#a442a183">KeyRCONTROL</a>])
00131 {
00132 <a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp0">_KeyArray</a>.clear(KeyCONTROL);
00133
00134 <span class="keywordflow">if</span>(<a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp2">_KeyReleaseArray</a>.get(KeyCONTROL))
00135 {
00136 <a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp1">_KeyDownArray</a>.clear (KeyCONTROL);
00137 <a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp2">_KeyReleaseArray</a>.clear (KeyCONTROL);
00138 }
00139 }
00140 <span class="keywordflow">break</span>;
00141 <span class="keywordflow">case</span> <a class="code" href="a05378.html#a442a181">KeyRSHIFT</a>:
00142 <span class="keywordflow">case</span> <a class="code" href="a05378.html#a442a180">KeyLSHIFT</a>:
00143 <span class="keywordflow">if</span> (!<a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp0">_KeyArray</a>[<a class="code" href="a05378.html#a442a180">KeyLSHIFT</a>] && !<a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp0">_KeyArray</a>[<a class="code" href="a05378.html#a442a181">KeyRSHIFT</a>])
00144 {
00145 <a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp0">_KeyArray</a>.clear(KeySHIFT);
00146
00147 <span class="keywordflow">if</span>(<a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp2">_KeyReleaseArray</a>.get(KeySHIFT))
00148 {
00149 <a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp1">_KeyDownArray</a>.clear (KeySHIFT);
00150 <a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp2">_KeyReleaseArray</a>.clear (KeySHIFT);
00151 }
00152 }
00153 <span class="keywordflow">break</span>;
00154 <span class="keywordflow">case</span> <a class="code" href="a05378.html#a442a185">KeyRMENU</a>:
00155 <span class="keywordflow">case</span> <a class="code" href="a05378.html#a442a184">KeyLMENU</a>:
00156 <span class="keywordflow">if</span> (!<a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp0">_KeyArray</a>[<a class="code" href="a05378.html#a442a184">KeyLMENU</a>] && !<a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp0">_KeyArray</a>[<a class="code" href="a05378.html#a442a185">KeyRMENU</a>])
00157 {
00158 <a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp0">_KeyArray</a>.clear(KeyMENU);
00159
00160 <span class="keywordflow">if</span>(<a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp2">_KeyReleaseArray</a>.get(KeyMENU))
00161 {
00162 <a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp1">_KeyDownArray</a>.clear (KeyMENU);
00163 <a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp2">_KeyReleaseArray</a>.clear (KeyMENU);
00164 }
00165 }
00166 <span class="keywordflow">break</span>;
00167 <span class="keywordflow">default</span>: <span class="keywordflow">break</span>;
00168 }
00169
00170
00171 <span class="comment">// Do not "raise up" the key, until someone has get the state of this key.</span>
00172 <span class="keywordflow">if</span>(<a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp2">_KeyReleaseArray</a>.get(pEvent->Key))
00173 {
00174 <a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp1">_KeyDownArray</a>.clear (pEvent->Key);
00175 <a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp2">_KeyReleaseArray</a>.clear (pEvent->Key);
00176 }
00177
00178 }
00179 <span class="comment">// Activate false ?</span>
00180 <span class="keywordflow">if</span> (event==<a class="code" href="a05378.html#a51">EventSetFocusId</a>)
00181 {
00182 CEventSetFocus *pEvent=(CEventSetFocus *)&event;
00183 <span class="keywordflow">if</span> (!pEvent->Get)
00184 {
00185 <span class="comment">// Disactive all keys</span>
00186 <a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp0">_KeyArray</a>.clearAll ();
00187 <a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp1">_KeyDownArray</a>.clearAll ();
00188 <a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp2">_KeyReleaseArray</a>.clearAll ();
00189 }
00190 }
00191 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLMISC_1_1CEventListenerAsynca4" doxytag="NLMISC::CEventListenerAsync::removeFromServer" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NLMISC::CEventListenerAsync::removeFromServer </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a02479.html">CEventServer</a> & </td>
<td class="mdname1" valign="top" nowrap> <em>server</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Unregister the listener to the server.
<p>
Definition at line <a class="el" href="a05684.html#l00065">65</a> of file <a class="el" href="a05684.html">event_listener.cpp</a>.
<p>
References <a class="el" href="a05378.html#a47">NLMISC::EventKeyDownId</a>, <a class="el" href="a05378.html#a48">NLMISC::EventKeyUpId</a>, <a class="el" href="a05378.html#a51">NLMISC::EventSetFocusId</a>, and <a class="el" href="a05688.html#l00114">NLMISC::CEventServer::removeListener()</a>.
<p>
Referenced by <a class="el" href="a05657.html#l00285">NL3D::CDriverUser::release()</a>, and <a class="el" href="a05686.html#l00332">NL3D::CEvent3dMouseListener::removeFromServer()</a>.
<p>
<div class="fragment"><pre>00066 {
00067 server.removeListener (EventKeyUpId, <span class="keyword">this</span>);
00068 server.removeListener (EventKeyDownId, <span class="keyword">this</span>);
00069 server.removeListener (EventSetFocusId, <span class="keyword">this</span>);
00070 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NLMISC_1_1CEventListenerAsynca5" doxytag="NLMISC::CEventListenerAsync::reset" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NLMISC::CEventListenerAsync::reset </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Clear all the Down states to false. Usefull sometimes when you don't bother what have been pushed before. e.g.: your app listen/test to the key 'A' and 'B' for a certain long period. Then, it test 'C' and 'D' later. If the user has press (by error) the key 'C' during the first period, this API has record it, and then, at the second period, isKeyDown(KeyC) will return true the first time the key is tested, unless if you do a <a class="el" href="a02472.html#NLMISC_1_1CEventListenerAsynca5">reset()</a> at the beggining of the second period. Clear all the pushed states to false too. <dl compact><dt><b>See also:</b></dt><dd><a class="el" href="a02472.html#NLMISC_1_1CEventListenerAsynca2">isKeyDown()</a></dd></dl>
<p>
Definition at line <a class="el" href="a05684.html#l00195">195</a> of file <a class="el" href="a05684.html">event_listener.cpp</a>.
<p>
References <a class="el" href="a05685.html#l00118">_KeyArray</a>, <a class="el" href="a05685.html#l00120">_KeyDownArray</a>, <a class="el" href="a05685.html#l00120">_KeyReleaseArray</a>, and <a class="el" href="a05484.html#l00125">NLMISC::CBitSet::clearAll()</a>.
<p>
Referenced by <a class="el" href="a05684.html#l00050">CEventListenerAsync()</a>, and <a class="el" href="a05657.html#l00230">NL3D::CDriverUser::setDisplay()</a>.
<p>
<div class="fragment"><pre>00196 {
00197 <a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp0">_KeyArray</a>.clearAll ();
00198 <a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp1">_KeyDownArray</a>.clearAll ();
00199 <a class="code" href="a02472.html#NLMISC_1_1CEventListenerAsyncp2">_KeyReleaseArray</a>.clearAll ();
00200 }
</pre></div> </td>
</tr>
</table>
<hr><h2>Field Documentation</h2>
<a class="anchor" name="NLMISC_1_1CEventListenerAsyncp0" doxytag="NLMISC::CEventListenerAsync::_KeyArray" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a02272.html">CBitSet</a> <a class="el" href="a02472.html#NLMISC_1_1CEventListenerAsyncp0">NLMISC::CEventListenerAsync::_KeyArray</a><code> [protected]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05685.html#l00118">118</a> of file <a class="el" href="a05685.html">event_listener.h</a>.
<p>
Referenced by <a class="el" href="a05684.html#l00050">CEventListenerAsync()</a>, <a class="el" href="a05684.html#l00072">isKeyDown()</a>, <a class="el" href="a05684.html#l00089">operator()()</a>, and <a class="el" href="a05684.html#l00195">reset()</a>. </td>
</tr>
</table>
<a class="anchor" name="NLMISC_1_1CEventListenerAsyncp1" doxytag="NLMISC::CEventListenerAsync::_KeyDownArray" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a02272.html">CBitSet</a> <a class="el" href="a02472.html#NLMISC_1_1CEventListenerAsyncp1">NLMISC::CEventListenerAsync::_KeyDownArray</a><code> [protected]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05685.html#l00120">120</a> of file <a class="el" href="a05685.html">event_listener.h</a>.
<p>
Referenced by <a class="el" href="a05684.html#l00050">CEventListenerAsync()</a>, <a class="el" href="a05684.html#l00078">isKeyPushed()</a>, <a class="el" href="a05684.html#l00089">operator()()</a>, and <a class="el" href="a05684.html#l00195">reset()</a>. </td>
</tr>
</table>
<a class="anchor" name="NLMISC_1_1CEventListenerAsyncp2" doxytag="NLMISC::CEventListenerAsync::_KeyReleaseArray" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a02272.html">CBitSet</a> <a class="el" href="a02472.html#NLMISC_1_1CEventListenerAsyncp2">NLMISC::CEventListenerAsync::_KeyReleaseArray</a><code> [protected]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05685.html#l00120">120</a> of file <a class="el" href="a05685.html">event_listener.h</a>.
<p>
Referenced by <a class="el" href="a05684.html#l00050">CEventListenerAsync()</a>, <a class="el" href="a05684.html#l00078">isKeyPushed()</a>, <a class="el" href="a05684.html#l00089">operator()()</a>, and <a class="el" href="a05684.html#l00195">reset()</a>. </td>
</tr>
</table>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="a05685.html">event_listener.h</a><li><a class="el" href="a05684.html">event_listener.cpp</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 13:10:56 2004 for NeL by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.6 </small></address>
</body>
</html>
|