Skip to content
Snippets Groups Projects
Commit f9d7acbf authored by Rémi Bernon's avatar Rémi Bernon :speech_balloon: Committed by Alexandre Julliard
Browse files

winejoystick.drv: Remove unnecessary driver.

parent 4f1095a0
No related branches found
No related tags found
No related merge requests found
......@@ -1717,7 +1717,6 @@ enable_winecrt0
enable_wined3d
enable_winegstreamer
enable_winehid_sys
enable_winejoystick_drv
enable_winemac_drv
enable_winemapi
enable_wineoss_drv
......@@ -8317,12 +8316,6 @@ if test "x$ac_cv_header_linux_ioctl_h" = xyes
then :
printf "%s\n" "#define HAVE_LINUX_IOCTL_H 1" >>confdefs.h
 
fi
ac_fn_c_check_header_compile "$LINENO" "linux/joystick.h" "ac_cv_header_linux_joystick_h" "$ac_includes_default"
if test "x$ac_cv_header_linux_joystick_h" = xyes
then :
printf "%s\n" "#define HAVE_LINUX_JOYSTICK_H 1" >>confdefs.h
fi
ac_fn_c_check_header_compile "$LINENO" "linux/major.h" "ac_cv_header_linux_major_h" "$ac_includes_default"
if test "x$ac_cv_header_linux_major_h" = xyes
......@@ -10870,7 +10863,6 @@ esac
enable_winecoreaudio_drv=${enable_winecoreaudio_drv:-no}
enable_wineandroid_drv=${enable_wineandroid_drv:-no}
enable_winemac_drv=${enable_winemac_drv:-no}
test "$ac_cv_header_linux_joystick_h" = "yes" -o "$ac_cv_header_IOKit_hid_IOHIDLib_h" = "yes" || enable_winejoystick_drv=${enable_winejoystick_drv:-no}
 
 
if test "x$with_mingw" != xno
......@@ -20567,53 +20559,6 @@ printf "%s\n" "#define HAVE_LINUX_GETHOSTBYNAME_R_6 1" >>confdefs.h
 
fi
 
if test "$ac_cv_header_linux_joystick_h" = "yes"
then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether linux/joystick.h uses the Linux 2.2+ API" >&5
printf %s "checking whether linux/joystick.h uses the Linux 2.2+ API... " >&6; }
if test ${wine_cv_linux_joystick_22_api+y}
then :
printf %s "(cached) " >&6
else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/ioctl.h>
#include <sys/types.h>
#include <linux/joystick.h>
struct js_event blub;
#if !defined(JS_EVENT_AXIS) || !defined(JS_EVENT_BUTTON)
#error "no 2.2 header"
#endif
int
main (void)
{
/*empty*/
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
wine_cv_linux_joystick_22_api=yes
else $as_nop
wine_cv_linux_joystick_22_api=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wine_cv_linux_joystick_22_api" >&5
printf "%s\n" "$wine_cv_linux_joystick_22_api" >&6; }
if test "$wine_cv_linux_joystick_22_api" = "yes"
then
printf "%s\n" "#define HAVE_LINUX_22_JOYSTICK_API 1" >>confdefs.h
fi
fi
ac_fn_c_check_member "$LINENO" "struct msghdr" "msg_accrights" "ac_cv_member_struct_msghdr_msg_accrights" "#include <sys/types.h>
#include <sys/socket.h>
#ifdef HAVE_SYS_UN_H
......@@ -22516,7 +22461,6 @@ wine_fn_config_makefile dlls/winecrt0 enable_winecrt0
wine_fn_config_makefile dlls/wined3d enable_wined3d
wine_fn_config_makefile dlls/winegstreamer enable_winegstreamer
wine_fn_config_makefile dlls/winehid.sys enable_winehid_sys
wine_fn_config_makefile dlls/winejoystick.drv enable_winejoystick_drv
wine_fn_config_makefile dlls/winemac.drv enable_winemac_drv
wine_fn_config_makefile dlls/winemapi enable_winemapi
wine_fn_config_makefile dlls/wineoss.drv enable_wineoss_drv
......
......@@ -445,7 +445,6 @@ AC_CHECK_HEADERS(\
linux/hidraw.h \
linux/input.h \
linux/ioctl.h \
linux/joystick.h \
linux/major.h \
linux/param.h \
linux/serial.h \
......@@ -866,7 +865,6 @@ esac
enable_winecoreaudio_drv=${enable_winecoreaudio_drv:-no}
enable_wineandroid_drv=${enable_wineandroid_drv:-no}
enable_winemac_drv=${enable_winemac_drv:-no}
test "$ac_cv_header_linux_joystick_h" = "yes" -o "$ac_cv_header_IOKit_hid_IOHIDLib_h" = "yes" || enable_winejoystick_drv=${enable_winejoystick_drv:-no}
dnl Check for cross compiler to build test programs
AC_SUBST(CROSSTARGET)
......@@ -2108,28 +2106,6 @@ AC_CACHE_CHECK([whether we can use re-entrant gethostbyname_r Linux style],
[Define if Linux-style gethostbyname_r and gethostbyaddr_r are available])
fi
if test "$ac_cv_header_linux_joystick_h" = "yes"
then
AC_CACHE_CHECK([whether linux/joystick.h uses the Linux 2.2+ API],
wine_cv_linux_joystick_22_api,
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/ioctl.h>
#include <sys/types.h>
#include <linux/joystick.h>
struct js_event blub;
#if !defined(JS_EVENT_AXIS) || !defined(JS_EVENT_BUTTON)
#error "no 2.2 header"
#endif
]], [[/*empty*/]])],[wine_cv_linux_joystick_22_api=yes],[wine_cv_linux_joystick_22_api=no])
)
if test "$wine_cv_linux_joystick_22_api" = "yes"
then
AC_DEFINE(HAVE_LINUX_22_JOYSTICK_API, 1,
[Define if <linux/joystick.h> defines the Linux 2.2 joystick API])
fi
fi
dnl Check for socket structure members
AC_CHECK_MEMBERS([struct msghdr.msg_accrights, struct sockaddr_un.sun_len],,,
[#include <sys/types.h>
......@@ -3409,7 +3385,6 @@ WINE_CONFIG_MAKEFILE(dlls/winecrt0)
WINE_CONFIG_MAKEFILE(dlls/wined3d)
WINE_CONFIG_MAKEFILE(dlls/winegstreamer)
WINE_CONFIG_MAKEFILE(dlls/winehid.sys)
WINE_CONFIG_MAKEFILE(dlls/winejoystick.drv)
WINE_CONFIG_MAKEFILE(dlls/winemac.drv)
WINE_CONFIG_MAKEFILE(dlls/winemapi)
WINE_CONFIG_MAKEFILE(dlls/wineoss.drv)
......
MODULE = winejoystick.drv
IMPORTS = winmm user32
EXTRALIBS = $(IOKIT_LIBS)
EXTRADLLFLAGS = -mcygwin
C_SRCS = \
joystick.c \
joystick_linux.c \
joystick_osx.c
/*
* WinMM joystick driver common code
*
* Copyright 1997 Andreas Mohr
* Copyright 2000 Wolfgang Schwotzer
* Copyright 2002 David Hagood
*
* 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
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "joystick.h"
/**************************************************************************
* DriverProc (JOYSTICK.@)
*/
LRESULT CALLBACK JSTCK_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg, LPARAM dwParam1, LPARAM dwParam2)
{
switch(wMsg) {
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);
case JDD_SETCALIBRATION:
case JDD_CONFIGCHANGED: return JOYERR_NOCANDO;
case JDD_GETPOSEX: return driver_joyGetPosEx(dwDevID, (LPJOYINFOEX)dwParam1);
default:
return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
}
}
/*
* WinMM joystick driver header
*
* Copyright 2015 Ken Thomases for CodeWeavers Inc.
*
* 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
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "mmddk.h"
#include "winuser.h"
LRESULT driver_open(LPSTR str, DWORD index) DECLSPEC_HIDDEN;
LRESULT driver_close(DWORD_PTR device_id) DECLSPEC_HIDDEN;
LRESULT driver_joyGetDevCaps(DWORD_PTR device_id, JOYCAPSW* caps, DWORD size) DECLSPEC_HIDDEN;
LRESULT driver_joyGetPosEx(DWORD_PTR device_id, JOYINFOEX* info) DECLSPEC_HIDDEN;
LRESULT driver_joyGetPos(DWORD_PTR device_id, JOYINFO* info) DECLSPEC_HIDDEN;
/*
* joystick functions
*
* Copyright 1997 Andreas Mohr
* Copyright 2000 Wolfgang Schwotzer
* Copyright 2002 David Hagood
*
* 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
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* NOTES:
*
* - nearly all joystick functions can be regarded as obsolete,
* as Linux (2.1.x) now supports extended joysticks with a completely
* new joystick driver interface
* New driver's documentation says:
* "For backward compatibility the old interface is still included,
* but will be dropped in the future."
* Thus we should implement the new interface and at most keep the old
* routines for backward compatibility.
* - better support of enhanced joysticks (Linux 2.2 interface is available)
* - support more joystick drivers (like the XInput extension)
* - should load joystick DLL as any other driver (instead of hardcoding)
* the driver's name, and load it as any low lever driver.
*/
#include "config.h"
#ifdef HAVE_LINUX_22_JOYSTICK_API
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#ifdef HAVE_LINUX_IOCTL_H
#include <linux/ioctl.h>
#endif
#include <linux/joystick.h>
#ifdef SW_MAX
#undef SW_MAX
#endif
#define JOYDEV_NEW "/dev/input/js%d"
#define JOYDEV_OLD "/dev/js%d"
#include <errno.h>
#include "joystick.h"
#include "wingdi.h"
#include "winnls.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(joystick);
#define MAXJOYSTICK (JOYSTICKID2 + 30)
typedef struct tagWINE_JSTCK {
int joyIntf;
BOOL in_use;
/* Some extra info we need to make this actually work under the
Linux 2.2 event api.
First of all, we cannot keep closing and reopening the device file -
that blows away the state of the stick device, and we lose events. So, we
need to open the low-level device once, and close it when we are done.
Secondly, the event API only gives us what's changed. However, Windows apps
want the whole state every time, so we have to cache the data.
*/
int dev; /* Linux level device file descriptor */
int x;
int y;
int z;
int r;
int u;
int v;
int pov_x;
int pov_y;
int buttons;
char axesMap[ABS_MAX + 1];
} WINE_JSTCK;
static WINE_JSTCK JSTCK_Data[MAXJOYSTICK];
/**************************************************************************
* JSTCK_drvGet [internal]
*/
static WINE_JSTCK *JSTCK_drvGet(DWORD_PTR dwDevID)
{
int p;
if ((dwDevID - (DWORD_PTR)JSTCK_Data) % sizeof(JSTCK_Data[0]) != 0)
return NULL;
p = (dwDevID - (DWORD_PTR)JSTCK_Data) / sizeof(JSTCK_Data[0]);
if (p < 0 || p >= MAXJOYSTICK || !((WINE_JSTCK*)dwDevID)->in_use)
return NULL;
return (WINE_JSTCK*)dwDevID;
}
/**************************************************************************
* driver_open
*/
LRESULT driver_open(LPSTR str, DWORD dwIntf)
{
if (dwIntf >= MAXJOYSTICK || JSTCK_Data[dwIntf].in_use)
return 0;
JSTCK_Data[dwIntf].joyIntf = dwIntf;
JSTCK_Data[dwIntf].dev = -1;
JSTCK_Data[dwIntf].in_use = TRUE;
return (LRESULT)&JSTCK_Data[dwIntf];
}
/**************************************************************************
* driver_close
*/
LRESULT driver_close(DWORD_PTR dwDevID)
{
WINE_JSTCK* jstck = JSTCK_drvGet(dwDevID);
if (jstck == NULL)
return 0;
jstck->in_use = FALSE;
if (jstck->dev > 0)
{
close(jstck->dev);
jstck->dev = 0;
}
return 1;
}
struct js_status
{
int buttons;
int x;
int y;
};
/**************************************************************************
* JSTCK_OpenDevice [internal]
*/
static int JSTCK_OpenDevice(WINE_JSTCK* jstick)
{
char buf[20];
int flags, fd, found_ix, i;
static DWORD last_attempt;
DWORD now;
if (jstick->dev > 0)
return jstick->dev;
now = GetTickCount();
if (now - last_attempt < 2000)
return -1;
last_attempt = now;
flags = O_RDONLY | O_NONBLOCK;
/* The first joystick may not be at /dev/input/js0, find the correct
* first or second device. For example the driver for XBOX 360 wireless
* receiver creates entries starting at 20.
*/
for (found_ix = i = 0; i < MAXJOYSTICK; i++) {
sprintf(buf, JOYDEV_NEW, i);
if ((fd = open(buf, flags)) < 0) {
sprintf(buf, JOYDEV_OLD, i);
if ((fd = open(buf, flags)) < 0)
continue;
}
if (found_ix++ == jstick->joyIntf)
{
TRACE("Found joystick[%d] at %s\n", jstick->joyIntf, buf);
jstick->dev = fd;
last_attempt = 0;
break;
}
close(fd);
}
if (jstick->dev > 0)
ioctl(jstick->dev, JSIOCGAXMAP, jstick->axesMap);
return jstick->dev;
}
/**************************************************************************
* JoyGetDevCaps [MMSYSTEM.102]
*/
LRESULT driver_joyGetDevCaps(DWORD_PTR dwDevID, LPJOYCAPSW lpCaps, DWORD dwSize)
{
WINE_JSTCK* jstck;
int dev;
char nrOfAxes;
char nrOfButtons;
char identString[MAXPNAMELEN];
int i;
int driverVersion;
if ((jstck = JSTCK_drvGet(dwDevID)) == NULL)
return MMSYSERR_NODRIVER;
if ((dev = JSTCK_OpenDevice(jstck)) < 0) return JOYERR_PARMS;
ioctl(dev, JSIOCGAXES, &nrOfAxes);
ioctl(dev, JSIOCGBUTTONS, &nrOfButtons);
ioctl(dev, JSIOCGVERSION, &driverVersion);
ioctl(dev, JSIOCGNAME(sizeof(identString)), identString);
TRACE("Driver: 0x%06x, Name: %s, #Axes: %d, #Buttons: %d\n",
driverVersion, identString, nrOfAxes, nrOfButtons);
lpCaps->wMid = MM_MICROSOFT;
lpCaps->wPid = MM_PC_JOYSTICK;
MultiByteToWideChar(CP_UNIXCP, 0, identString, -1, lpCaps->szPname, MAXPNAMELEN);
lpCaps->szPname[MAXPNAMELEN-1] = '\0';
lpCaps->wXmin = 0;
lpCaps->wXmax = 0xFFFF;
lpCaps->wYmin = 0;
lpCaps->wYmax = 0xFFFF;
lpCaps->wZmin = 0;
lpCaps->wZmax = (nrOfAxes >= 3) ? 0xFFFF : 0;
#ifdef BODGE_THE_HAT
/* Half-Life won't allow you to map an axis event to things like
"next weapon" and "use". Linux reports the hat on my stick as
axis U and V. So, IFF BODGE_THE_HAT is defined, lie through our
teeth and say we have 32 buttons, and we will map the axes to
the high buttons. Really, perhaps this should be a registry entry,
or even a parameter to the Linux joystick driver (which would completely
remove the need for this.)
*/
lpCaps->wNumButtons = 32;
#else
lpCaps->wNumButtons = nrOfButtons;
#endif
if (dwSize == sizeof(JOYCAPSW)) {
/* complete 95 structure */
lpCaps->wRmin = 0;
lpCaps->wRmax = 0xFFFF;
lpCaps->wUmin = 0;
lpCaps->wUmax = 0xFFFF;
lpCaps->wVmin = 0;
lpCaps->wVmax = 0xFFFF;
lpCaps->wMaxAxes = 6; /* same as MS Joystick Driver */
lpCaps->wNumAxes = 0; /* nr of axes in use */
lpCaps->wMaxButtons = 32; /* same as MS Joystick Driver */
lpCaps->szRegKey[0] = 0;
lpCaps->szOEMVxD[0] = 0;
lpCaps->wCaps = 0;
for (i = 0; i < nrOfAxes; i++) {
switch (jstck->axesMap[i]) {
case 0: /* X */
case 1: /* Y */
case 8: /* Wheel */
case 9: /* Gas */
lpCaps->wNumAxes++;
break;
case 2: /* Z */
case 6: /* Throttle */
case 10: /* Brake */
lpCaps->wNumAxes++;
lpCaps->wCaps |= JOYCAPS_HASZ;
break;
case 5: /* Rz */
case 7: /* Rudder */
lpCaps->wNumAxes++;
lpCaps->wCaps |= JOYCAPS_HASR;
break;
case 3: /* Rx */
lpCaps->wNumAxes++;
lpCaps->wCaps |= JOYCAPS_HASU;
break;
case 4: /* Ry */
lpCaps->wNumAxes++;
lpCaps->wCaps |= JOYCAPS_HASV;
break;
case 16: /* Hat 0 X */
case 17: /* Hat 0 Y */
lpCaps->wCaps |= JOYCAPS_HASPOV | JOYCAPS_POV4DIR;
/* TODO: JOYCAPS_POVCTS handling */
break;
default:
WARN("Unknown axis %hhu(%u). Skipped.\n", jstck->axesMap[i], i);
}
}
}
return JOYERR_NOERROR;
}
/**************************************************************************
* driver_joyGetPos
*/
LRESULT driver_joyGetPosEx(DWORD_PTR dwDevID, LPJOYINFOEX lpInfo)
{
WINE_JSTCK* jstck;
int dev;
struct js_event ev;
if ((jstck = JSTCK_drvGet(dwDevID)) == NULL)
return MMSYSERR_NODRIVER;
if ((dev = JSTCK_OpenDevice(jstck)) < 0) return JOYERR_PARMS;
while ((read(dev, &ev, sizeof(struct js_event))) > 0) {
if (ev.type == (JS_EVENT_AXIS)) {
switch (jstck->axesMap[ev.number]) {
case 0: /* X */
case 8: /* Wheel */
jstck->x = ev.value;
break;
case 1: /* Y */
case 9: /* Gas */
jstck->y = ev.value;
break;
case 2: /* Z */
case 6: /* Throttle */
case 10: /* Brake */
jstck->z = ev.value;
break;
case 5: /* Rz */
case 7: /* Rudder */
jstck->r = ev.value;
break;
case 3: /* Rx */
jstck->u = ev.value;
break;
case 4: /* Ry */
jstck->v = ev.value;
break;
case 16: /* Hat 0 X */
jstck->pov_x = ev.value;
break;
case 17: /* Hat 0 Y */
jstck->pov_y = ev.value;
break;
default:
FIXME("Unknown joystick event '%d'\n", ev.number);
}
} else if (ev.type == (JS_EVENT_BUTTON)) {
if (ev.value) {
jstck->buttons |= (1 << ev.number);
/* FIXME: what to do for this field when
* multiple buttons are depressed ?
*/
if (lpInfo->dwFlags & JOY_RETURNBUTTONS)
lpInfo->dwButtonNumber = ev.number + 1;
}
else
jstck->buttons &= ~(1 << ev.number);
}
}
/* EAGAIN is returned when the queue is empty */
if (errno != EAGAIN) {
/* FIXME: error should not be ignored */
ERR("Error while reading joystick state (%s)\n", strerror(errno));
}
/* Now, copy the cached values into Window's structure... */
if (lpInfo->dwFlags & JOY_RETURNBUTTONS)
lpInfo->dwButtons = jstck->buttons;
if (lpInfo->dwFlags & JOY_RETURNX)
lpInfo->dwXpos = jstck->x + 32767;
if (lpInfo->dwFlags & JOY_RETURNY)
lpInfo->dwYpos = jstck->y + 32767;
if (lpInfo->dwFlags & JOY_RETURNZ)
lpInfo->dwZpos = jstck->z + 32767;
if (lpInfo->dwFlags & JOY_RETURNR)
lpInfo->dwRpos = jstck->r + 32767;
# ifdef BODGE_THE_HAT
else if (lpInfo->dwFlags & JOY_RETURNBUTTONS)
{
if (jstck->r > 0)
lpInfo->dwButtons |= 1<<7;
else if (jstck->r < 0)
lpInfo->dwButtons |= 1<<8;
}
# endif
if (lpInfo->dwFlags & JOY_RETURNU)
lpInfo->dwUpos = jstck->u + 32767;
# ifdef BODGE_THE_HAT
else if (lpInfo->dwFlags & JOY_RETURNBUTTONS)
{
if (jstck->u > 0)
lpInfo->dwButtons |= 1<<9;
else if (jstck->u < 0)
lpInfo->dwButtons |= 1<<10;
}
# endif
if (lpInfo->dwFlags & JOY_RETURNV)
lpInfo->dwVpos = jstck->v + 32767;
if (lpInfo->dwFlags & JOY_RETURNPOV) {
if (jstck->pov_y > 0) {
if (jstck->pov_x < 0)
lpInfo->dwPOV = 22500; /* SW */
else if (jstck->pov_x > 0)
lpInfo->dwPOV = 13500; /* SE */
else
lpInfo->dwPOV = 18000; /* S, JOY_POVBACKWARD */
} else if (jstck->pov_y < 0) {
if (jstck->pov_x < 0)
lpInfo->dwPOV = 31500; /* NW */
else if (jstck->pov_x > 0)
lpInfo->dwPOV = 4500; /* NE */
else
lpInfo->dwPOV = 0; /* N, JOY_POVFORWARD */
} else if (jstck->pov_x < 0)
lpInfo->dwPOV = 27000; /* W, JOY_POVLEFT */
else if (jstck->pov_x > 0)
lpInfo->dwPOV = 9000; /* E, JOY_POVRIGHT */
else
lpInfo->dwPOV = JOY_POVCENTERED; /* Center */
}
TRACE("x: %d, y: %d, z: %d, r: %d, u: %d, v: %d, buttons: 0x%04x, flags: 0x%04x (fd %d)\n",
lpInfo->dwXpos, lpInfo->dwYpos, lpInfo->dwZpos,
lpInfo->dwRpos, lpInfo->dwUpos, lpInfo->dwVpos,
lpInfo->dwButtons, lpInfo->dwFlags, dev
);
return JOYERR_NOERROR;
}
/**************************************************************************
* driver_joyGetPos
*/
LRESULT driver_joyGetPos(DWORD_PTR dwDevID, LPJOYINFO lpInfo)
{
JOYINFOEX ji;
LONG ret;
memset(&ji, 0, sizeof(ji));
ji.dwSize = sizeof(ji);
ji.dwFlags = JOY_RETURNX | JOY_RETURNY | JOY_RETURNZ | JOY_RETURNBUTTONS;
ret = driver_joyGetPosEx(dwDevID, &ji);
if (ret == JOYERR_NOERROR) {
lpInfo->wXpos = ji.dwXpos;
lpInfo->wYpos = ji.dwYpos;
lpInfo->wZpos = ji.dwZpos;
lpInfo->wButtons = ji.dwButtons;
}
return ret;
}
#endif /* HAVE_LINUX_JOYSTICK_H */
This diff is collapsed.
@ stdcall -private DriverProc(long long long long long) JSTCK_DriverProc
......@@ -188,9 +188,6 @@
/* Define to 1 if you have the <link.h> header file. */
#undef HAVE_LINK_H
/* Define if <linux/joystick.h> defines the Linux 2.2 joystick API */
#undef HAVE_LINUX_22_JOYSTICK_API
/* Define to 1 if you have the <linux/capi.h> header file. */
#undef HAVE_LINUX_CAPI_H
......@@ -221,9 +218,6 @@
/* Define to 1 if you have the <linux/irda.h> header file. */
#undef HAVE_LINUX_IRDA_H
/* Define to 1 if you have the <linux/joystick.h> header file. */
#undef HAVE_LINUX_JOYSTICK_H
/* Define to 1 if you have the <linux/major.h> header file. */
#undef HAVE_LINUX_MAJOR_H
......
......@@ -5615,19 +5615,6 @@ IUnknown *
IWineD3D *
IWineD3DClipper *
%%winejoystick.drv
%long
HDRVR
LPARAM
LRESULT
UINT
%long --pointer
DWORD_PTR
%%l3codeca.acm
%long
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment