Add support for OpenBSD's ujoy(4)
parent
9a01eac57d
commit
3f93ec470a
|
@ -23,7 +23,7 @@
|
||||||
#ifdef SDL_JOYSTICK_USBHID
|
#ifdef SDL_JOYSTICK_USBHID
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Joystick driver for the uhid(4) interface found in OpenBSD,
|
* Joystick driver for the uhid(4) / ujoy(4) interface found in OpenBSD,
|
||||||
* NetBSD and FreeBSD.
|
* NetBSD and FreeBSD.
|
||||||
*
|
*
|
||||||
* Maintainer: <vedge at csoft.org>
|
* Maintainer: <vedge at csoft.org>
|
||||||
|
@ -226,7 +226,11 @@ BSD_JoystickInit(void)
|
||||||
for (i = 0; i < MAX_UHID_JOYS; i++) {
|
for (i = 0; i < MAX_UHID_JOYS; i++) {
|
||||||
SDL_Joystick nj;
|
SDL_Joystick nj;
|
||||||
|
|
||||||
SDL_snprintf(s, SDL_arraysize(s), "/dev/uhid%d", i);
|
#if defined(__OpenBSD__) && (OpenBSD >= 202105)
|
||||||
|
SDL_snprintf(s, SDL_arraysize(s), "/dev/ujoy/%d", i);
|
||||||
|
#else
|
||||||
|
SDL_snprintf(s, SDL_arraysize(s), "/dev/uhid/%d", i);
|
||||||
|
#endif
|
||||||
|
|
||||||
joynames[numjoysticks] = SDL_strdup(s);
|
joynames[numjoysticks] = SDL_strdup(s);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue