1//========================================================================
2// GLFW 3.2 Linux - www.glfw.org
3//------------------------------------------------------------------------
4// Copyright (c) 2014 Jonas Ã…dahl <jadahl@gmail.com>
5//
6// This software is provided 'as-is', without any express or implied
7// warranty. In no event will the authors be held liable for any damages
8// arising from the use of this software.
9//
10// Permission is granted to anyone to use this software for any purpose,
11// including commercial applications, and to alter it and redistribute it
12// freely, subject to the following restrictions:
13//
14// 1. The origin of this software must not be misrepresented; you must not
15// claim that you wrote the original software. If you use this software
16// in a product, an acknowledgment in the product documentation would
17// be appreciated but is not required.
18//
19// 2. Altered source versions must be plainly marked as such, and must not
20// be misrepresented as being the original software.
21//
22// 3. This notice may not be removed or altered from any source
23// distribution.
24//
25//========================================================================
26
27#ifndef _glfw3_linux_joystick_h_
28#define _glfw3_linux_joystick_h_
29
30#include <regex.h>
31
32#define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE _GLFWjoylistLinux linux_js
33
34
35// Linux-specific joystick data
36//
37typedef struct _GLFWjoystickLinux
38{
39 GLFWbool present;
40 int fd;
41 float* axes;
42 int axisCount;
43 unsigned char* buttons;
44 int buttonCount;
45 char* name;
46 char* path;
47} _GLFWjoystickLinux;
48
49
50// Linux-specific joystick API data
51//
52typedef struct _GLFWjoylistLinux
53{
54 _GLFWjoystickLinux js[GLFW_JOYSTICK_LAST + 1];
55
56#if defined(__linux__)
57 int inotify;
58 int watch;
59 regex_t regex;
60#endif /*__linux__*/
61} _GLFWjoylistLinux;
62
63
64GLFWbool _glfwInitJoysticksLinux(void);
65void _glfwTerminateJoysticksLinux(void);
66
67void _glfwPollJoystickEvents(void);
68
69#endif // _glfw3_linux_joystick_h_
70