2000-02-26 14:14:04 +01:00
|
|
|
/*
|
2015-03-17 00:43:49 +01:00
|
|
|
* WinMM joystick driver common code
|
2000-02-26 14:14:04 +01:00
|
|
|
*
|
|
|
|
* Copyright 1997 Andreas Mohr
|
2002-09-04 20:43:05 +02:00
|
|
|
* Copyright 2000 Wolfgang Schwotzer
|
|
|
|
* Copyright 2002 David Hagood
|
2000-02-26 14:14:04 +01:00
|
|
|
*
|
2002-03-10 00:29:33 +01:00
|
|
|
* 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
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2000-02-26 14:14:04 +01:00
|
|
|
*/
|
2000-03-19 13:41:41 +01:00
|
|
|
|
2015-03-17 00:43:49 +01:00
|
|
|
#include "joystick.h"
|
2000-02-26 14:14:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
/**************************************************************************
|
2015-03-17 00:43:49 +01:00
|
|
|
* DriverProc (JOYSTICK.@)
|
2000-02-26 14:14:04 +01:00
|
|
|
*/
|
2015-03-17 00:43:49 +01:00
|
|
|
LRESULT CALLBACK JSTCK_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg, LPARAM dwParam1, LPARAM dwParam2)
|
2000-02-26 14:14:04 +01:00
|
|
|
{
|
|
|
|
switch(wMsg) {
|
2015-03-17 00:43:49 +01:00
|
|
|
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);
|
2002-06-01 01:06:46 +02:00
|
|
|
case JDD_SETCALIBRATION:
|
2015-03-17 00:43:49 +01:00
|
|
|
case JDD_CONFIGCHANGED: return JOYERR_NOCANDO;
|
|
|
|
case JDD_GETPOSEX: return driver_joyGetPosEx(dwDevID, (LPJOYINFOEX)dwParam1);
|
2000-02-26 14:14:04 +01:00
|
|
|
default:
|
2015-03-17 00:43:49 +01:00
|
|
|
return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
|
2000-02-26 14:14:04 +01:00
|
|
|
}
|
|
|
|
}
|