2008-04-11 05:43:15 -06:00
|
|
|
/*
|
2008-04-24 11:12:59 -06:00
|
|
|
** Xbox360 USB Gamepad Userspace Driver
|
2008-04-11 05:43:15 -06:00
|
|
|
** Copyright (C) 2008 Ingo Ruhnke <grumbel@gmx.de>
|
2008-04-10 15:43:54 -06:00
|
|
|
**
|
2008-04-11 05:43:15 -06:00
|
|
|
** This program is free software: you can redistribute it and/or modify
|
|
|
|
** it under the terms of the GNU General Public License as published by
|
|
|
|
** the Free Software Foundation, either version 3 of the License, or
|
|
|
|
** (at your option) any later version.
|
2008-04-10 15:43:54 -06:00
|
|
|
**
|
|
|
|
** This program 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 General Public License for more details.
|
2008-04-11 05:43:15 -06:00
|
|
|
**
|
2008-04-10 15:43:54 -06:00
|
|
|
** You should have received a copy of the GNU General Public License
|
2008-04-11 05:43:15 -06:00
|
|
|
** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2008-04-10 15:43:54 -06:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef HEADER_UINPUT_HPP
|
|
|
|
#define HEADER_UINPUT_HPP
|
|
|
|
|
2008-04-13 12:19:54 -06:00
|
|
|
#include "xboxdrv.hpp"
|
2008-04-10 15:43:54 -06:00
|
|
|
|
2008-05-01 01:15:40 -06:00
|
|
|
class Xbox360Msg;
|
|
|
|
class Xbox360GuitarMsg;
|
|
|
|
class XboxMsg;
|
|
|
|
|
2008-04-13 08:56:31 -06:00
|
|
|
class uInputCfg
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool trigger_as_button;
|
2008-04-13 09:08:27 -06:00
|
|
|
bool dpad_as_button;
|
2008-04-13 09:22:14 -06:00
|
|
|
bool trigger_as_zaxis;
|
2008-04-13 08:56:31 -06:00
|
|
|
|
|
|
|
uInputCfg() {
|
|
|
|
trigger_as_button = false;
|
2008-04-13 09:08:27 -06:00
|
|
|
dpad_as_button = false;
|
2008-04-13 09:22:14 -06:00
|
|
|
trigger_as_zaxis = false;
|
2008-04-13 08:56:31 -06:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2008-04-10 15:43:54 -06:00
|
|
|
class uInput
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
int fd;
|
2008-04-13 08:56:31 -06:00
|
|
|
uInputCfg config;
|
2008-04-10 15:43:54 -06:00
|
|
|
|
|
|
|
public:
|
2008-04-13 08:56:31 -06:00
|
|
|
uInput(GamepadType type, uInputCfg cfg = uInputCfg());
|
2008-04-10 15:43:54 -06:00
|
|
|
~uInput();
|
2008-04-17 21:01:04 -06:00
|
|
|
|
|
|
|
void setup_xbox360_gamepad(GamepadType type);
|
|
|
|
void setup_xbox360_guitar();
|
2008-04-10 15:43:54 -06:00
|
|
|
|
2008-04-24 11:12:59 -06:00
|
|
|
void send(Xbox360Msg& msg);
|
|
|
|
void send(Xbox360GuitarMsg& msg);
|
|
|
|
void send(XboxMsg& msg);
|
2008-04-17 15:02:28 -06:00
|
|
|
|
2008-04-10 15:43:54 -06:00
|
|
|
void send_button(uint16_t code, int32_t value);
|
|
|
|
void send_axis(uint16_t code, int32_t value);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* EOF */
|