2008-08-25 09:55:03 +00:00
|
|
|
/*
|
2011-04-08 13:03:26 -07:00
|
|
|
Simple DirectMedia Layer
|
2019-01-04 22:01:14 -08:00
|
|
|
Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
|
2011-04-08 13:03:26 -07:00
|
|
|
|
|
|
|
This software is provided 'as-is', without any express or implied
|
|
|
|
warranty. In no event will the authors be held liable for any damages
|
|
|
|
arising from the use of this software.
|
|
|
|
|
|
|
|
Permission is granted to anyone to use this software for any purpose,
|
|
|
|
including commercial applications, and to alter it and redistribute it
|
|
|
|
freely, subject to the following restrictions:
|
|
|
|
|
|
|
|
1. The origin of this software must not be misrepresented; you must not
|
|
|
|
claim that you wrote the original software. If you use this software
|
|
|
|
in a product, an acknowledgment in the product documentation would be
|
|
|
|
appreciated but is not required.
|
|
|
|
2. Altered source versions must be plainly marked as such, and must not be
|
|
|
|
misrepresented as being the original software.
|
|
|
|
3. This notice may not be removed or altered from any source distribution.
|
2008-08-25 09:55:03 +00:00
|
|
|
*/
|
|
|
|
|
2018-10-28 21:36:48 +01:00
|
|
|
#ifndef SDL_sysjoystick_c_h_
|
|
|
|
#define SDL_sysjoystick_c_h_
|
|
|
|
|
2008-08-25 09:55:03 +00:00
|
|
|
#include <linux/input.h>
|
|
|
|
|
2012-12-13 22:26:30 -05:00
|
|
|
struct SDL_joylist_item;
|
|
|
|
|
2008-08-25 09:55:03 +00:00
|
|
|
/* The private structure used to keep track of a joystick */
|
|
|
|
struct joystick_hwdata
|
|
|
|
{
|
|
|
|
int fd;
|
2012-12-13 22:26:30 -05:00
|
|
|
struct SDL_joylist_item *item;
|
2012-12-11 12:08:36 -08:00
|
|
|
SDL_JoystickGUID guid;
|
2008-08-25 09:55:03 +00:00
|
|
|
char *fname; /* Used in haptic subsystem */
|
|
|
|
|
2018-08-09 16:00:17 -07:00
|
|
|
SDL_bool ff_rumble;
|
|
|
|
SDL_bool ff_sine;
|
|
|
|
struct ff_effect effect;
|
|
|
|
|
2013-05-01 11:59:54 +02:00
|
|
|
/* The current Linux joystick driver maps hats to two axes */
|
2008-08-25 09:55:03 +00:00
|
|
|
struct hwdata_hat
|
|
|
|
{
|
|
|
|
int axis[2];
|
|
|
|
} *hats;
|
2013-05-01 11:59:54 +02:00
|
|
|
/* The current Linux joystick driver maps balls to two axes */
|
2008-08-25 09:55:03 +00:00
|
|
|
struct hwdata_ball
|
|
|
|
{
|
|
|
|
int axis[2];
|
|
|
|
} *balls;
|
|
|
|
|
|
|
|
/* Support for the Linux 2.4 unified input interface */
|
2016-11-22 22:14:28 -08:00
|
|
|
Uint8 key_map[KEY_MAX];
|
2008-08-25 09:55:03 +00:00
|
|
|
Uint8 abs_map[ABS_MAX];
|
|
|
|
struct axis_correct
|
|
|
|
{
|
|
|
|
int used;
|
|
|
|
int coef[3];
|
|
|
|
} abs_correct[ABS_MAX];
|
2013-02-11 16:45:24 -08:00
|
|
|
|
|
|
|
int fresh;
|
2017-09-22 08:30:52 -07:00
|
|
|
|
|
|
|
/* Steam Controller support */
|
|
|
|
SDL_bool m_bSteamController;
|
2019-06-12 10:32:36 -07:00
|
|
|
/* 4 = (ABS_HAT3X-ABS_HAT0X)/2 (see input-event-codes.h in kernel) */
|
|
|
|
int hats_indices[4];
|
2008-08-25 09:55:03 +00:00
|
|
|
};
|
2013-02-11 16:45:24 -08:00
|
|
|
|
2018-10-28 21:36:48 +01:00
|
|
|
#endif /* SDL_sysjoystick_c_h_ */
|
|
|
|
|
2013-02-11 16:45:24 -08:00
|
|
|
/* vi: set ts=4 sw=4 expandtab: */
|