AntiMicroX
Loading...
Searching...
No Matches
xbox360wireless.h
Go to the documentation of this file.
1/* antimicrox Gamepad to KB+M event mapper
2 * Copyright (C) 2015 Travis Nickles <nickles.travis@gmail.com>
3 * Copyright (C) 2020 Jagoda Górska <juliagoda.pl@protonmail>
4 * Copyright (C) 2020 Paweł Kotiuk <kotiuk@zohomail.eu>
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef XBOX360WIRELESS_H
21#define XBOX360WIRELESS_H
22
23#include <SDL2/SDL_joystick.h>
24
26{
27 Sint16 initial_value; /* Initial axis state */
28 Sint16 value; /* Current axis state */
29 Sint16 zero; /* Zero point on the axis (-32768 for triggers) */
30 SDL_bool has_initial_value; /* Whether we've seen a value on the axis yet */
31 SDL_bool sent_initial_value; /* Whether we've sent the initial axis value */
33
35{
36 SDL_JoystickID instance_id; /* Device instance, monotonically increasing from 0 */
37 char *name; /* Joystick name - system dependent */
38 int player_index; /* Joystick player index, or -1 if unavailable */
39 SDL_JoystickGUID guid; /* Joystick guid */
40
41 int naxes; /* Number of axis controls on the joystick */
43
44 int nhats; /* Number of hats on the joystick */
45 Uint8 *hats; /* Current hat states */
46
47 int nballs; /* Number of trackballs on the joystick */
48 struct balldelta
49 {
50 int dx;
51 int dy;
52 } * balls; /* Current ball motion deltas */
53
54 int nbuttons; /* Number of buttons on the joystick */
55 Uint8 *buttons; /* Current button states */
56
57 SDL_bool attached;
59 SDL_bool delayed_guide_button; /* SDL_TRUE if this device has the guide button event delayed */
60 SDL_bool force_recentering; /* SDL_TRUE if this device needs to have its state reset to 0 */
61 SDL_JoystickPowerLevel epowerlevel; /* power level of this joystick, SDL_JOYSTICK_POWER_UNKNOWN if not supported */
62 struct _SDL_JoystickDriver *driver;
63
64 struct joystick_hwdata *hwdata; /* Driver dependent information */
65
66 int ref_count; /* Reference count for multiple opens */
67
68 struct _SDL_Joystick *next; /* pointer to next joystick we have allocated */
69};
70
72{
73 public:
76
77 char *GUID();
78 char *name();
79 unsigned int deviceId();
80 int controllerType();
81 SDL_JoystickType joystickType();
82 SDL_JoystickGUID joyGUID();
83 SDL_Joystick *getResult();
84
85 private:
86 SDL_Joystick *result;
87};
88
89#endif
Definition xbox360wireless.h:72
char * name()
Definition xbox360wireless.cpp:79
~Xbox360Wireless()
Definition xbox360wireless.cpp:65
SDL_Joystick * result
Definition xbox360wireless.h:86
SDL_Joystick * getResult()
Definition xbox360wireless.cpp:92
SDL_JoystickGUID joyGUID()
Definition xbox360wireless.cpp:90
int controllerType()
Definition xbox360wireless.cpp:83
char * GUID()
Definition xbox360wireless.cpp:77
SDL_JoystickType joystickType()
Definition xbox360wireless.cpp:88
unsigned int deviceId()
Definition xbox360wireless.cpp:81
Xbox360Wireless()
Definition xbox360wireless.cpp:25
Definition xbox360wireless.h:26
Sint16 initial_value
Definition xbox360wireless.h:27
SDL_bool sent_initial_value
Definition xbox360wireless.h:31
Sint16 zero
Definition xbox360wireless.h:29
SDL_bool has_initial_value
Definition xbox360wireless.h:30
Sint16 value
Definition xbox360wireless.h:28
Definition xbox360wireless.h:49
int dx
Definition xbox360wireless.h:50
int dy
Definition xbox360wireless.h:51
Definition xbox360wireless.h:35
SDL_JoystickPowerLevel epowerlevel
Definition xbox360wireless.h:61
int ref_count
Definition xbox360wireless.h:66
int nhats
Definition xbox360wireless.h:44
Uint8 * buttons
Definition xbox360wireless.h:55
struct joystick_hwdata * hwdata
Definition xbox360wireless.h:64
int player_index
Definition xbox360wireless.h:38
SDL_bool is_game_controller
Definition xbox360wireless.h:58
SDL_JoystickAxisInfo * axes
Definition xbox360wireless.h:42
struct _SDL_JoystickDriver * driver
Definition xbox360wireless.h:62
SDL_JoystickGUID guid
Definition xbox360wireless.h:39
int nballs
Definition xbox360wireless.h:47
SDL_bool attached
Definition xbox360wireless.h:57
int naxes
Definition xbox360wireless.h:41
Uint8 * hats
Definition xbox360wireless.h:45
SDL_JoystickID instance_id
Definition xbox360wireless.h:36
struct _SDL_Joystick * next
Definition xbox360wireless.h:68
char * name
Definition xbox360wireless.h:37
int nbuttons
Definition xbox360wireless.h:54
SDL_bool force_recentering
Definition xbox360wireless.h:60
struct _SDL_Joystick::balldelta * balls
SDL_bool delayed_guide_button
Definition xbox360wireless.h:59
struct _SDL_JoystickAxisInfo SDL_JoystickAxisInfo