joystick.c 2.21 KB
Newer Older
1
/*
2
 * WinMM joystick driver common code
3 4
 *
 * Copyright 1997 Andreas Mohr
5 6
 * Copyright 2000 Wolfgang Schwotzer
 * Copyright 2002 David Hagood
7
 *
8 9 10 11 12 13 14 15 16 17 18 19
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
20
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21
 */
22

23
#include "joystick.h"
24 25 26


/**************************************************************************
27
 *                              DriverProc (JOYSTICK.@)
28
 */
29
LRESULT CALLBACK JSTCK_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg, LPARAM dwParam1, LPARAM dwParam2)
30 31
{
    switch(wMsg) {
32 33 34 35 36 37 38 39 40 41 42 43 44 45
    case DRV_LOAD:              return 1;
    case DRV_FREE:              return 1;
    case DRV_OPEN:              return driver_open((LPSTR)dwParam1, dwParam2);
    case DRV_CLOSE:             return driver_close(dwDevID);
    case DRV_ENABLE:            return 1;
    case DRV_DISABLE:           return 1;
    case DRV_QUERYCONFIGURE:    return 1;
    case DRV_CONFIGURE:         MessageBoxA(0, "JoyStick MultiMedia Driver !", "JoyStick Driver", MB_OK);       return 1;
    case DRV_INSTALL:           return DRVCNF_RESTART;
    case DRV_REMOVE:            return DRVCNF_RESTART;

    case JDD_GETNUMDEVS:        return 1;
    case JDD_GETDEVCAPS:        return driver_joyGetDevCaps(dwDevID, (LPJOYCAPSW)dwParam1, dwParam2);
    case JDD_GETPOS:            return driver_joyGetPos(dwDevID, (LPJOYINFO)dwParam1);
46
    case JDD_SETCALIBRATION:
47 48
    case JDD_CONFIGCHANGED:     return JOYERR_NOCANDO;
    case JDD_GETPOSEX:          return driver_joyGetPosEx(dwDevID, (LPJOYINFOEX)dwParam1);
49
    default:
50
        return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
51 52
    }
}