~ubuntu-dev/wxwidgets2.6/upstream-debian

« back to all changes in this revision

Viewing changes to src/msw/joystick.cpp

  • Committer: Daniel T Chen
  • Date: 2006-06-26 10:15:11 UTC
  • Revision ID: crimsun@ubuntu.com-20060626101511-a4436cec4c6d9b35
ImportĀ DebianĀ 2.6.3.2.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/////////////////////////////////////////////////////////////////////////////
 
2
// Name:        src/msw/joystick.cpp
 
3
// Purpose:     wxJoystick class
 
4
// Author:      Julian Smart
 
5
// Modified by:
 
6
// Created:     04/01/98
 
7
// RCS-ID:      $Id: joystick.cpp,v 1.23.2.2 2006/01/25 19:41:08 JS Exp $
 
8
// Copyright:   (c) Julian Smart
 
9
// Licence:     wxWindows licence
 
10
/////////////////////////////////////////////////////////////////////////////
 
11
 
 
12
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 
13
#pragma implementation "joystick.h"
 
14
#endif
 
15
 
 
16
// For compilers that support precompilation, includes "wx.h".
 
17
#include "wx/wxprec.h"
 
18
 
 
19
#ifdef __BORLANDC__
 
20
#pragma hdrstop
 
21
#endif
 
22
 
 
23
#if wxUSE_JOYSTICK
 
24
 
 
25
#include "wx/joystick.h"
 
26
#include "wx/string.h"
 
27
#include "wx/window.h"
 
28
#include "wx/msw/private.h"
 
29
 
 
30
#if !defined(__GNUWIN32_OLD__) || defined(__CYGWIN10__)
 
31
    #include <mmsystem.h>
 
32
#endif
 
33
 
 
34
// Why doesn't BC++ have joyGetPosEx?
 
35
#if !defined(__WIN32__) || defined(__BORLANDC__)
 
36
#define NO_JOYGETPOSEX
 
37
#endif
 
38
 
 
39
#include "wx/window.h"
 
40
#include "wx/msw/registry.h"
 
41
 
 
42
#include <regstr.h>
 
43
 
 
44
IMPLEMENT_DYNAMIC_CLASS(wxJoystick, wxObject)
 
45
 
 
46
// Attributes
 
47
////////////////////////////////////////////////////////////////////////////
 
48
 
 
49
/**
 
50
    johan@linkdata.se 2002-08-20:
 
51
    Now returns only valid, functioning
 
52
    joysticks, counting from the first
 
53
    available and upwards.
 
54
*/
 
55
wxJoystick::wxJoystick(int joystick)
 
56
{
 
57
    JOYINFO joyInfo;
 
58
    int i, maxsticks;
 
59
 
 
60
    maxsticks = joyGetNumDevs();
 
61
    for( i=0; i<maxsticks; i++ )
 
62
    {
 
63
        if( joyGetPos(i, & joyInfo) == JOYERR_NOERROR )
 
64
        {
 
65
            if( !joystick )
 
66
            {
 
67
                /* Found the one we want, store actual OS id and return */
 
68
                m_joystick = i;
 
69
                return;
 
70
            }
 
71
            joystick --;
 
72
        }
 
73
    }
 
74
 
 
75
    /* No such joystick, return ID 0 */
 
76
    m_joystick = 0;
 
77
    return;
 
78
};
 
79
 
 
80
wxPoint wxJoystick::GetPosition() const
 
81
{
 
82
    JOYINFO joyInfo;
 
83
    MMRESULT res = joyGetPos(m_joystick, & joyInfo);
 
84
    if (res == JOYERR_NOERROR )
 
85
        return wxPoint(joyInfo.wXpos, joyInfo.wYpos);
 
86
    else
 
87
        return wxPoint(0,0);
 
88
}
 
89
 
 
90
int wxJoystick::GetZPosition() const
 
91
{
 
92
    JOYINFO joyInfo;
 
93
    MMRESULT res = joyGetPos(m_joystick, & joyInfo);
 
94
    if (res == JOYERR_NOERROR )
 
95
        return joyInfo.wZpos;
 
96
    else
 
97
        return 0;
 
98
}
 
99
 
 
100
/**
 
101
    johan@linkdata.se 2002-08-20:
 
102
    Return a bitmap with all button states in it,
 
103
    like the GTK version does and Win32 does.
 
104
*/
 
105
int wxJoystick::GetButtonState() const
 
106
{
 
107
    JOYINFO joyInfo;
 
108
    MMRESULT res = joyGetPos(m_joystick, & joyInfo);
 
109
    if (res == JOYERR_NOERROR )
 
110
    {
 
111
        return joyInfo.wButtons;
 
112
#if 0
 
113
        int buttons = 0;
 
114
 
 
115
        if (joyInfo.wButtons & JOY_BUTTON1)
 
116
            buttons |= wxJOY_BUTTON1;
 
117
        if (joyInfo.wButtons & JOY_BUTTON2)
 
118
            buttons |= wxJOY_BUTTON2;
 
119
        if (joyInfo.wButtons & JOY_BUTTON3)
 
120
            buttons |= wxJOY_BUTTON3;
 
121
        if (joyInfo.wButtons & JOY_BUTTON4)
 
122
            buttons |= wxJOY_BUTTON4;
 
123
 
 
124
        return buttons;
 
125
#endif
 
126
    }
 
127
    else
 
128
        return 0;
 
129
}
 
130
 
 
131
/**
 
132
    JLI 2002-08-20:
 
133
    Returns -1 to signify error.
 
134
*/
 
135
int wxJoystick::GetPOVPosition() const
 
136
{
 
137
#ifndef NO_JOYGETPOSEX
 
138
    JOYINFOEX joyInfo;
 
139
    joyInfo.dwFlags = JOY_RETURNPOV;
 
140
    joyInfo.dwSize = sizeof(joyInfo);
 
141
    MMRESULT res = joyGetPosEx(m_joystick, & joyInfo);
 
142
    if (res == JOYERR_NOERROR )
 
143
    {
 
144
        return joyInfo.dwPOV;
 
145
    }
 
146
    else
 
147
        return -1;
 
148
#else
 
149
    return -1;
 
150
#endif
 
151
}
 
152
 
 
153
/**
 
154
    johan@linkdata.se 2002-08-20:
 
155
    Returns -1 to signify error.
 
156
*/
 
157
int wxJoystick::GetPOVCTSPosition() const
 
158
{
 
159
#ifndef NO_JOYGETPOSEX
 
160
    JOYINFOEX joyInfo;
 
161
    joyInfo.dwFlags = JOY_RETURNPOVCTS;
 
162
    joyInfo.dwSize = sizeof(joyInfo);
 
163
    MMRESULT res = joyGetPosEx(m_joystick, & joyInfo);
 
164
    if (res == JOYERR_NOERROR )
 
165
    {
 
166
        return joyInfo.dwPOV;
 
167
    }
 
168
    else
 
169
        return -1;
 
170
#else
 
171
    return -1;
 
172
#endif
 
173
}
 
174
 
 
175
int wxJoystick::GetRudderPosition() const
 
176
{
 
177
#ifndef NO_JOYGETPOSEX
 
178
    JOYINFOEX joyInfo;
 
179
    joyInfo.dwFlags = JOY_RETURNR;
 
180
    joyInfo.dwSize = sizeof(joyInfo);
 
181
    MMRESULT res = joyGetPosEx(m_joystick, & joyInfo);
 
182
    if (res == JOYERR_NOERROR )
 
183
    {
 
184
        return joyInfo.dwRpos;
 
185
    }
 
186
    else
 
187
        return 0;
 
188
#else
 
189
    return 0;
 
190
#endif
 
191
}
 
192
 
 
193
int wxJoystick::GetUPosition() const
 
194
{
 
195
#ifndef NO_JOYGETPOSEX
 
196
    JOYINFOEX joyInfo;
 
197
    joyInfo.dwFlags = JOY_RETURNU;
 
198
    joyInfo.dwSize = sizeof(joyInfo);
 
199
    MMRESULT res = joyGetPosEx(m_joystick, & joyInfo);
 
200
    if (res == JOYERR_NOERROR )
 
201
    {
 
202
        return joyInfo.dwUpos;
 
203
    }
 
204
    else
 
205
        return 0;
 
206
#else
 
207
    return 0;
 
208
#endif
 
209
}
 
210
 
 
211
int wxJoystick::GetVPosition() const
 
212
{
 
213
#ifndef NO_JOYGETPOSEX
 
214
    JOYINFOEX joyInfo;
 
215
    joyInfo.dwFlags = JOY_RETURNV;
 
216
    joyInfo.dwSize = sizeof(joyInfo);
 
217
    MMRESULT res = joyGetPosEx(m_joystick, & joyInfo);
 
218
    if (res == JOYERR_NOERROR )
 
219
    {
 
220
        return joyInfo.dwVpos;
 
221
    }
 
222
    else
 
223
        return 0;
 
224
#else
 
225
    return 0;
 
226
#endif
 
227
}
 
228
 
 
229
int wxJoystick::GetMovementThreshold() const
 
230
{
 
231
    UINT thresh = 0;
 
232
    MMRESULT res = joyGetThreshold(m_joystick, & thresh);
 
233
    if (res == JOYERR_NOERROR )
 
234
    {
 
235
        return thresh;
 
236
    }
 
237
    else
 
238
        return 0;
 
239
}
 
240
 
 
241
void wxJoystick::SetMovementThreshold(int threshold)
 
242
{
 
243
    UINT thresh = threshold;
 
244
    joySetThreshold(m_joystick, thresh);
 
245
}
 
246
 
 
247
// Capabilities
 
248
////////////////////////////////////////////////////////////////////////////
 
249
 
 
250
/**
 
251
    johan@linkdata.se 2002-08-20:
 
252
    Now returns the number of connected, functioning
 
253
    joysticks, as intended.
 
254
*/
 
255
int wxJoystick::GetNumberJoysticks()
 
256
{
 
257
    JOYINFO joyInfo;
 
258
    int i, maxsticks, actualsticks;
 
259
    maxsticks = joyGetNumDevs();
 
260
    actualsticks = 0;
 
261
    for( i=0; i<maxsticks; i++ )
 
262
    {
 
263
        if( joyGetPos( i, & joyInfo ) == JOYERR_NOERROR )
 
264
        {
 
265
            actualsticks ++;
 
266
        }
 
267
    }
 
268
    return actualsticks;
 
269
}
 
270
 
 
271
/**
 
272
    johan@linkdata.se 2002-08-20:
 
273
    The old code returned true if there were any
 
274
    joystick capable drivers loaded (=always).
 
275
*/
 
276
bool wxJoystick::IsOk() const
 
277
{
 
278
    JOYINFO joyInfo;
 
279
    return (joyGetPos(m_joystick, & joyInfo) == JOYERR_NOERROR);
 
280
}
 
281
 
 
282
int wxJoystick::GetManufacturerId() const
 
283
{
 
284
    JOYCAPS joyCaps;
 
285
    if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
 
286
        return 0;
 
287
    else
 
288
        return joyCaps.wMid;
 
289
}
 
290
 
 
291
int wxJoystick::GetProductId() const
 
292
{
 
293
    JOYCAPS joyCaps;
 
294
    if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
 
295
        return 0;
 
296
    else
 
297
        return joyCaps.wPid;
 
298
}
 
299
 
 
300
wxString wxJoystick::GetProductName() const
 
301
{
 
302
#ifdef __WINE__
 
303
    return wxEmptyString;
 
304
#else
 
305
    JOYCAPS joyCaps;
 
306
    if (joyGetDevCaps(m_joystick, &joyCaps, sizeof(joyCaps)) != JOYERR_NOERROR)
 
307
        return wxEmptyString;
 
308
 
 
309
    wxRegKey key1(wxString::Format(wxT("HKEY_LOCAL_MACHINE\\%s\\%s\\%s"),
 
310
                   REGSTR_PATH_JOYCONFIG, joyCaps.szRegKey, REGSTR_KEY_JOYCURR));
 
311
 
 
312
    wxString str;
 
313
    key1.QueryValue(wxString::Format(wxT("Joystick%d%s"),
 
314
                                     m_joystick + 1, REGSTR_VAL_JOYOEMNAME),
 
315
                    str);
 
316
 
 
317
    wxRegKey key2(wxString::Format(wxT("HKEY_LOCAL_MACHINE\\%s\\%s"),
 
318
                                        REGSTR_PATH_JOYOEM, str.c_str()));
 
319
    key2.QueryValue(REGSTR_VAL_JOYOEMNAME, str);
 
320
 
 
321
    return str;
 
322
#endif
 
323
}
 
324
 
 
325
int wxJoystick::GetXMin() const
 
326
{
 
327
    JOYCAPS joyCaps;
 
328
    if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
 
329
        return 0;
 
330
    else
 
331
        return joyCaps.wXmin;
 
332
}
 
333
 
 
334
int wxJoystick::GetYMin() const
 
335
{
 
336
    JOYCAPS joyCaps;
 
337
    if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
 
338
        return 0;
 
339
    else
 
340
        return joyCaps.wYmin;
 
341
}
 
342
 
 
343
int wxJoystick::GetZMin() const
 
344
{
 
345
    JOYCAPS joyCaps;
 
346
    if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
 
347
        return 0;
 
348
    else
 
349
        return joyCaps.wZmin;
 
350
}
 
351
 
 
352
int wxJoystick::GetXMax() const
 
353
{
 
354
    JOYCAPS joyCaps;
 
355
    if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
 
356
        return 0;
 
357
    else
 
358
        return joyCaps.wXmax;
 
359
}
 
360
 
 
361
int wxJoystick::GetYMax() const
 
362
{
 
363
    JOYCAPS joyCaps;
 
364
    if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
 
365
        return 0;
 
366
    else
 
367
        return joyCaps.wYmax;
 
368
}
 
369
 
 
370
int wxJoystick::GetZMax() const
 
371
{
 
372
    JOYCAPS joyCaps;
 
373
    if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
 
374
        return 0;
 
375
    else
 
376
        return joyCaps.wZmax;
 
377
}
 
378
 
 
379
int wxJoystick::GetNumberButtons() const
 
380
{
 
381
    JOYCAPS joyCaps;
 
382
    if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
 
383
        return 0;
 
384
    else
 
385
        return joyCaps.wNumButtons;
 
386
}
 
387
 
 
388
int wxJoystick::GetNumberAxes() const
 
389
{
 
390
#if defined(__WIN32__)
 
391
    JOYCAPS joyCaps;
 
392
    if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
 
393
        return 0;
 
394
    else
 
395
        return joyCaps.wNumAxes;
 
396
#else
 
397
    return 0;
 
398
#endif
 
399
}
 
400
 
 
401
int wxJoystick::GetMaxButtons() const
 
402
{
 
403
#if defined(__WIN32__)
 
404
    JOYCAPS joyCaps;
 
405
    if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
 
406
        return 0;
 
407
    else
 
408
        return joyCaps.wMaxButtons;
 
409
#else
 
410
    return 0;
 
411
#endif
 
412
}
 
413
 
 
414
int wxJoystick::GetMaxAxes() const
 
415
{
 
416
#if defined(__WIN32__)
 
417
    JOYCAPS joyCaps;
 
418
    if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
 
419
        return 0;
 
420
    else
 
421
        return joyCaps.wMaxAxes;
 
422
#else
 
423
    return 0;
 
424
#endif
 
425
}
 
426
 
 
427
int wxJoystick::GetPollingMin() const
 
428
{
 
429
    JOYCAPS joyCaps;
 
430
    if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
 
431
        return 0;
 
432
    else
 
433
        return joyCaps.wPeriodMin;
 
434
}
 
435
 
 
436
int wxJoystick::GetPollingMax() const
 
437
{
 
438
    JOYCAPS joyCaps;
 
439
    if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
 
440
        return 0;
 
441
    else
 
442
        return joyCaps.wPeriodMax;
 
443
}
 
444
 
 
445
int wxJoystick::GetRudderMin() const
 
446
{
 
447
#if defined(__WIN32__)
 
448
    JOYCAPS joyCaps;
 
449
    if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
 
450
        return 0;
 
451
    else
 
452
        return joyCaps.wRmin;
 
453
#else
 
454
    return 0;
 
455
#endif
 
456
}
 
457
 
 
458
int wxJoystick::GetRudderMax() const
 
459
{
 
460
#if defined(__WIN32__)
 
461
    JOYCAPS joyCaps;
 
462
    if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
 
463
        return 0;
 
464
    else
 
465
        return joyCaps.wRmax;
 
466
#else
 
467
    return 0;
 
468
#endif
 
469
}
 
470
 
 
471
int wxJoystick::GetUMin() const
 
472
{
 
473
#if defined(__WIN32__)
 
474
    JOYCAPS joyCaps;
 
475
    if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
 
476
        return 0;
 
477
    else
 
478
        return joyCaps.wUmin;
 
479
#else
 
480
    return 0;
 
481
#endif
 
482
}
 
483
 
 
484
int wxJoystick::GetUMax() const
 
485
{
 
486
#if defined(__WIN32__)
 
487
    JOYCAPS joyCaps;
 
488
    if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
 
489
        return 0;
 
490
    else
 
491
        return joyCaps.wUmax;
 
492
#else
 
493
    return 0;
 
494
#endif
 
495
}
 
496
 
 
497
int wxJoystick::GetVMin() const
 
498
{
 
499
#if defined(__WIN32__)
 
500
    JOYCAPS joyCaps;
 
501
    if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
 
502
        return 0;
 
503
    else
 
504
        return joyCaps.wVmin;
 
505
#else
 
506
    return 0;
 
507
#endif
 
508
}
 
509
 
 
510
int wxJoystick::GetVMax() const
 
511
{
 
512
#if defined(__WIN32__)
 
513
    JOYCAPS joyCaps;
 
514
    if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
 
515
        return 0;
 
516
    else
 
517
        return joyCaps.wVmax;
 
518
#else
 
519
    return 0;
 
520
#endif
 
521
}
 
522
 
 
523
 
 
524
bool wxJoystick::HasRudder() const
 
525
{
 
526
#if defined(__WIN32__)
 
527
    JOYCAPS joyCaps;
 
528
    if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
 
529
        return false;
 
530
    else
 
531
        return ((joyCaps.wCaps & JOYCAPS_HASR) == JOYCAPS_HASR);
 
532
#else
 
533
    return false;
 
534
#endif
 
535
}
 
536
 
 
537
bool wxJoystick::HasZ() const
 
538
{
 
539
#if defined(__WIN32__)
 
540
    JOYCAPS joyCaps;
 
541
    if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
 
542
        return false;
 
543
    else
 
544
        return ((joyCaps.wCaps & JOYCAPS_HASZ) == JOYCAPS_HASZ);
 
545
#else
 
546
    return false;
 
547
#endif
 
548
}
 
549
 
 
550
bool wxJoystick::HasU() const
 
551
{
 
552
#if defined(__WIN32__)
 
553
    JOYCAPS joyCaps;
 
554
    if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
 
555
        return false;
 
556
    else
 
557
        return ((joyCaps.wCaps & JOYCAPS_HASU) == JOYCAPS_HASU);
 
558
#else
 
559
    return false;
 
560
#endif
 
561
}
 
562
 
 
563
bool wxJoystick::HasV() const
 
564
{
 
565
#if defined(__WIN32__)
 
566
    JOYCAPS joyCaps;
 
567
    if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
 
568
        return false;
 
569
    else
 
570
        return ((joyCaps.wCaps & JOYCAPS_HASV) == JOYCAPS_HASV);
 
571
#else
 
572
    return false;
 
573
#endif
 
574
}
 
575
 
 
576
bool wxJoystick::HasPOV() const
 
577
{
 
578
#if defined(__WIN32__)
 
579
    JOYCAPS joyCaps;
 
580
    if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
 
581
        return false;
 
582
    else
 
583
        return ((joyCaps.wCaps & JOYCAPS_HASPOV) == JOYCAPS_HASPOV);
 
584
#else
 
585
    return false;
 
586
#endif
 
587
}
 
588
 
 
589
bool wxJoystick::HasPOV4Dir() const
 
590
{
 
591
#if defined(__WIN32__)
 
592
    JOYCAPS joyCaps;
 
593
    if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
 
594
        return false;
 
595
    else
 
596
        return ((joyCaps.wCaps & JOYCAPS_POV4DIR) == JOYCAPS_POV4DIR);
 
597
#else
 
598
    return false;
 
599
#endif
 
600
}
 
601
 
 
602
bool wxJoystick::HasPOVCTS() const
 
603
{
 
604
#if defined(__WIN32__)
 
605
    JOYCAPS joyCaps;
 
606
    if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
 
607
        return false;
 
608
    else
 
609
        return ((joyCaps.wCaps & JOYCAPS_POVCTS) == JOYCAPS_POVCTS);
 
610
#else
 
611
    return false;
 
612
#endif
 
613
}
 
614
 
 
615
// Operations
 
616
////////////////////////////////////////////////////////////////////////////
 
617
 
 
618
bool wxJoystick::SetCapture(wxWindow* win, int pollingFreq)
 
619
{
 
620
    BOOL changed = (pollingFreq == 0);
 
621
    MMRESULT res = joySetCapture((HWND) win->GetHWND(), m_joystick, pollingFreq, changed);
 
622
    return (res == JOYERR_NOERROR);
 
623
}
 
624
 
 
625
bool wxJoystick::ReleaseCapture()
 
626
{
 
627
    MMRESULT res = joyReleaseCapture(m_joystick);
 
628
    return (res == JOYERR_NOERROR);
 
629
}
 
630
 
 
631
#endif // wxUSE_JOYSTICK