Commit 5f68e4d9 authored by Grumbel's avatar Grumbel

Imported Upstream version 0.8.6

parent df808c04
......@@ -2,22 +2,23 @@
*~
.sconf_temp/
.sconsign.dblite
/build*/
/doc/doxygen/
/libxboxdrv.a
/tools/usbcat
/tools/wiimote
/virtualkeyboard
/xboxdrv
cache/
config.log
custom.py
doc/xboxdrv-daemon.html/
doc/xboxdrv.ent
doc/xboxdrv.html/
libxboxdrv.a
incoming/
old
src/xboxdrv_controller_glue.hpp
src/xboxdrv_daemon_glue.hpp
src/xboxdrv_dbus_glue.hpp
src/xboxdrv_vfs.hpp
test/*_test
xboxdrv
/virtualkeyboard
incoming/
/tools/usbcat
/tools/wiimote
/doc/doxygen/
# Xbox/Xbox360 USB Gamepad Userspace Driver
# Copyright (C) 2008 Ingo Ruhnke <grumbel@gmail.com>
#
# 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.
#
# 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.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Build file for https://travis-ci.org/
#
# Configuration manual:
# http://docs.travis-ci.com/user/build-configuration/
language: cpp
compiler:
- gcc
- clang
matrix:
fast_finish: true
env:
matrix:
- BUILD_TYPE="development"
- BUILD_TYPE="release"
before_install:
- sudo apt-get update -qq
- sudo apt-get install build-essential scons g++ libboost-dev scons pkg-config libusb-1.0-0-dev libx11-dev libudev-dev x11proto-core-dev libdbus-glib-1-dev
script:
- git clean -f
- scons CXX=${CXX} BUILD=${BUILD_TYPE} && sudo make install
# EOF #
## Xbox/Xbox360 USB Gamepad Userspace Driver
## Copyright (C) 2010 Ingo Ruhnke <grumbel@gmx.de>
## Copyright (C) 2010 Ingo Ruhnke <grumbel@gmail.com>
##
## 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
......
xboxdrv 0.8.6 - (25/10/2015)
=============================
* Buttonevent exec: double fork to avoid zombies
* fixed axis handling in FourWayRestrictorModifier
* fixed device disconnect issues
* fixed segfault due to incorrect shutdown of USB subsystem
* fixed some compiler warnings/errors
* ignore Play'n Charge kit instead of error out
* added device support for Thrustmaster Gamepad GP XID, Razer
Sabertooth, Gamestop BB-070, Afterglow AX.1, MLG Pro Circuit
Controller (Xbox), Rock Candy, Saitek p3600, Hori GEM Xbox
controller
xboxdrv 0.8.5 - (07/Apr/2013)
=============================
......
[[ Xbox/Xbox360 USB Gamepad Driver for Userspace ]]
===================================================
Xbox/Xbox360 USB Gamepad Driver for Userspace
=============================================
Xboxdrv is a Xbox/Xbox360 gamepad driver for Linux that works in
userspace. It is an alternative to the xpad kernel driver and has
......@@ -24,9 +24,9 @@ The development version can be optained via:
* git clone http://pingus.seul.org/~grumbel/xboxdrv.git
[[ Compilation ]]
-----------------
Compilation
-----------
Required libraries and tools:
......@@ -44,11 +44,11 @@ Required libraries and tools:
Once everything installed, you can compile by typing:
$ scons
scons
On Ubuntu 10.10 you can install all the required libraries via:
$ sudo apt-get install \
sudo apt-get install \
g++ \
libboost1.42-dev \
scons \
......@@ -63,40 +63,37 @@ On Ubuntu 10.10 you can install all the required libraries via:
To load the uinput kernel module automatically on boot add it
/etc/modules, to load it manually type:
$ sudo modprobe uinput
sudo modprobe uinput
On other distributions exact install instructions might be
slightly different.
[[ Installation ]]
------------------
Installation
------------
Once the compilation process is complete you can install xboxdrv with:
$ make install
make install
You can also change the install PREFIX and DESTDIR as usual with:
$ make install PREFIX=/usr DESTDIR=/tmp
make install PREFIX=/usr DESTDIR=/tmp
Note that there is no need to install xboxdrv, you can run it directly
from the source directory if you prefer.
[[ Running ]]
-------------
Running
-------
Extensive documentation on running xboxdrv can be found in the RUNNING
XBOXDRV section of the xboxdrv manpage. When you haven't installed
xboxdrv the man page can be found in doc/xboxdrv.1 and be read with:
$ man -l doc/xboxdrv.1
man -l doc/xboxdrv.1
Documentation on xboxdrv-daemon, a daemon that will automatically
launch xboxdrv when a pad is plugged in can be read via:
$ man -l doc/xboxdrv-daemon.1
# EOF #
man -l doc/xboxdrv-daemon.1
......@@ -83,9 +83,11 @@ opts.Add('LIBS', 'Additional libraries')
opts.Add('CCFLAGS', 'C Compiler flags')
opts.Add('CXXFLAGS', 'C++ Compiler flags')
opts.Add('LINKFLAGS', 'Linker Compiler flags')
opts.Add('AR', 'Library archiver')
opts.Add('CC', 'C Compiler')
opts.Add('CXX', 'C++ Compiler')
opts.Add('BUILD', 'Build type: release, custom, development')
opts.Add('PKG_CONFIG', 'pkg-config helper tool', 'pkg-config')
opts.Update(env)
Help(opts.GenerateHelpText(env))
......@@ -114,11 +116,11 @@ elif 'BUILD' in env and env['BUILD'] == 'custom':
else:
env.Append(CPPFLAGS = ['-g', '-O3', '-Wall', '-ansi', '-pedantic'])
env.ParseConfig("pkg-config --cflags --libs dbus-glib-1 | sed 's/-I/-isystem/g'")
env.ParseConfig("pkg-config --cflags --libs glib-2.0 | sed 's/-I/-isystem/g'")
env.ParseConfig("pkg-config --cflags --libs gthread-2.0 | sed 's/-I/-isystem/g'")
env.ParseConfig("pkg-config --cflags --libs libusb-1.0 | sed 's/-I/-isystem/g'")
env.ParseConfig("pkg-config --cflags --libs libudev | sed 's/-I/-isystem/g'")
env.ParseConfig(env['PKG_CONFIG'] + " --cflags --libs dbus-glib-1 | sed 's/-I/-isystem/g'")
env.ParseConfig(env['PKG_CONFIG'] + " --cflags --libs glib-2.0 | sed 's/-I/-isystem/g'")
env.ParseConfig(env['PKG_CONFIG'] + " --cflags --libs gthread-2.0 | sed 's/-I/-isystem/g'")
env.ParseConfig(env['PKG_CONFIG'] + " --cflags --libs libusb-1.0 | sed 's/-I/-isystem/g'")
env.ParseConfig(env['PKG_CONFIG'] + " --cflags --libs libudev | sed 's/-I/-isystem/g'")
f = open("VERSION")
package_version = f.read()
......
0.8.5
\ No newline at end of file
0.8.6
\ No newline at end of file
......@@ -3118,7 +3118,7 @@ $ export SDL_JOYSTICK_DEVICE]]></programlisting>
<itemizedlist>
<listitem>
<para><ulink url="ftp://ptah.lnf.kth.se/pub/misc/sdl-env-vars">ftp://ptah.lnf.kth.se/pub/misc/sdl-env-vars</ulink></para>
<para><ulink url="http://sdl.beuc.net/sdl.wiki/SDL_envvars">http://sdl.beuc.net/sdl.wiki/SDL_envvars</ulink></para>
</listitem>
</itemizedlist>
......
......@@ -5,7 +5,8 @@
# Ergonomic 4000 keyboard to scroll wheel events.
[xboxdrv]
evdev = "/dev/input/by-id/usb-Microsoft_Natural®_Ergonomic_Keyboard_4000-event-kbd"
# evdev = "/dev/input/by-id/usb-Microsoft_Natural®_Ergonomic_Keyboard_4000-event-kbd"
evdev = "/dev/input/by-id/usb-Microsoft_Natural®_Ergonomic_Keyboard_4000-if01-event-kbd"
evdev-grab = false
ui-clear = true
......
# Playstation 4 Controller
# ========================
[xboxdrv]
# Using the 'by-id' name is recomment, as it is static, while an
# /dev/input/eventX name can change depending on what other USB
# devices you use.
evdev = /dev/input/by-id/usb-Sony_Computer_Entertainment_Wireless_Controller-event-joystick
# This displays events received from the controller, if you are
# working on a configuration you want to set this to true:
evdev-debug = false
# Grabbing the device prevents other applications from accessing it,
# this is needed most of the time te prevent applications from
# receiving events twice.
evdev-grab = true
[evdev-absmap]
ABS_HAT0X = dpad_x
ABS_HAT0Y = dpad_y
ABS_X = X1
ABS_Y = Y1
ABS_Z = X2
ABS_RZ = Y2
ABS_RX = LT
ABS_RY = RT
[evdev-keymap]
BTN_TL = LT
BTN_TR = RT
BTN_A = X
BTN_X = Y
BTN_B = A
BTN_C = B
BTN_Y = LB
BTN_Z = RB
BTN_SELECT = TL
BTN_START = TR
BTN_TR2 = start
BTN_TL2 = back
BTN_MODE = guide
# EOF #
......@@ -152,4 +152,16 @@
add(ABS_MT_PRESSURE, "ABS_MT_PRESSURE");
#endif
#ifdef ABS_MT_DISTANCE
add(ABS_MT_DISTANCE, "ABS_MT_DISTANCE");
#endif
#ifdef ABS_MT_TOOL_X
add(ABS_MT_TOOL_X, "ABS_MT_TOOL_X");
#endif
#ifdef ABS_MT_TOOL_Y
add(ABS_MT_TOOL_Y, "ABS_MT_TOOL_Y");
#endif
/* EOF */
/*
/*
** Xbox360 USB Gamepad Userspace Driver
** Copyright (C) 2008 Ingo Ruhnke <grumbel@gmx.de>
** Copyright (C) 2008 Ingo Ruhnke <grumbel@gmail.com>
**
** 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
......@@ -37,23 +37,23 @@ ArgParser::parse_args(int argc, char** argv)
programm = argv[0];
for(int i = 1; i < argc; ++i)
for(int i = 1; i < argc; ++i)
{
if (argv[i][0] == '-')
if (argv[i][0] == '-')
{
if (argv[i][1] == '-')
if (argv[i][1] == '-')
{
// We got a long option
if (argv[i][2] == '\0')
{
if (argv[i][2] == '\0')
{
// Got a '--', so we stop evaluating arguments
++i;
while(i < argc)
while(i < argc)
{
parsed_options.push_back(ParsedOption(ArgParser::REST_ARG, "", argv[i]));
++i;
}
}
}
else
{
std::string opt = argv[i] + 2;
......@@ -62,12 +62,12 @@ ArgParser::parse_args(int argc, char** argv)
std::string::size_type pos = opt.find('=');
if (pos != std::string::npos)
if (pos != std::string::npos)
{
long_opt = opt.substr(0, pos);
long_opt_arg = opt.substr(pos+1);
}
else
else
{
long_opt = opt;
}
......@@ -75,25 +75,25 @@ ArgParser::parse_args(int argc, char** argv)
// Long Option
Option* option = lookup_long_option(long_opt);
if (option)
if (option)
{
if (option->argument.empty())
if (option->argument.empty())
{
parsed_options.push_back(ParsedOption(option->key, long_opt, ""));
}
}
else
{
if (pos != std::string::npos)
if (pos != std::string::npos)
{
parsed_options.push_back(ParsedOption(option->key, long_opt, long_opt_arg));
}
else
{
if (i == argc - 1)
{
if (i == argc - 1)
{
throw std::runtime_error("option '" + std::string(argv[i]) + "' requires an argument");
}
else
else
{
parsed_options.push_back(ParsedOption(option->key, long_opt, argv[i + 1]));
++i;
......@@ -106,29 +106,29 @@ ArgParser::parse_args(int argc, char** argv)
throw std::runtime_error("unrecognized option '" + std::string(argv[i]) + "'");
}
}
}
else
}
else
{
// We got a short option
char* p = argv[i] + 1;
if (*p != '\0')
{
// Handle option chains
while (*p)
while (*p)
{
// Short option(s)
Option* option = lookup_short_option(*p);
if (option)
if (option)
{
if (option->argument.empty())
if (option->argument.empty())
{
parsed_options.push_back(ParsedOption(option->key, std::string(1, *p), ""));
}
else
}
else
{
if (i == argc - 1 || *(p+1) != '\0')
if (i == argc - 1 || *(p+1) != '\0')
{
// No more arguments
throw std::runtime_error("option requires an argument -- " + std::string(1, *p));
......@@ -139,20 +139,20 @@ ArgParser::parse_args(int argc, char** argv)
++i;
}
}
}
else
}
else
{
throw std::runtime_error("invalid option -- " + std::string(1, *p));
}
++p;
++p;
}
}
}
else
{
parsed_options.push_back(ParsedOption(ArgParser::REST_ARG, "", "-"));
}
}
}
}
else
{
parsed_options.push_back(ParsedOption(ArgParser::REST_ARG, "", argv[i]));
......@@ -189,7 +189,7 @@ ArgParser::print_help(std::ostream& out) const
{
const int terminal_width = get_terminal_width();
const int column_min_width = 8;
int column_width = column_min_width;
int column_width = column_min_width;
{ // Calculate left column width
for(Options::const_iterator i = options.begin(); i != options.end(); ++i)
......@@ -197,7 +197,7 @@ ArgParser::print_help(std::ostream& out) const
int width = 2; // add two leading space
if (i->short_option)
width += 2; // "-a"
if (!i->long_option.empty())
width += i->long_option.size() + 2; // "--foobar"
......@@ -223,27 +223,27 @@ ArgParser::print_help(std::ostream& out) const
{
if (i->visible)
{
if (i->key == USAGE)
if (i->key == USAGE)
{
if (first_usage)
if (first_usage)
{
out << "Usage: " << programm << " " << i->help << std::endl;
out << "Usage: " << programm << " " << i->help << std::endl;
first_usage = false;
}
else
{
out << " " << programm << " " << i->help << std::endl;
out << " " << programm << " " << i->help << std::endl;
}
}
else if (i->key == TEXT)
}
else if (i->key == TEXT)
{
pprint.print(i->help);
}
else if (i->key == PSEUDO)
else if (i->key == PSEUDO)
{
pprint.print(std::string(column_width, ' '), i->long_option, i->help);
}
else
else
{
char option[256] = { 0 };
char argument[256] = { 0 };
......@@ -305,14 +305,14 @@ ArgParser::add_pseudo(const std::string& left, const std::string& doc)
options.push_back(option);
return *this;
return *this;
}
ArgParser&
ArgParser::add_newline()
{
add_text("");
return *this;
}
......@@ -325,15 +325,15 @@ ArgParser::add_text(const std::string& grouptopic)
option.help = grouptopic;
option.visible = true;
options.push_back(option);
options.push_back(option);
return *this;
}
ArgParser&
ArgParser::add_option(int key,
char short_option,
const std::string& long_option,
ArgParser::add_option(int key,
char short_option,
const std::string& long_option,
const std::string& argument,
const std::string& help,
bool visible)
......@@ -363,7 +363,7 @@ int main(int argc, char** argv)
try
{
ArgParser argp;
argp
.add_usage("bar [FILES]... [BLA]..")
.add_usage("foo [FILES]... [BLA]..")
......
/*
/*
** Xbox360 USB Gamepad Userspace Driver
** Copyright (C) 2008 Ingo Ruhnke <grumbel@gmx.de>
** Copyright (C) 2008 Ingo Ruhnke <grumbel@gmail.com>
**
** 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
......@@ -51,14 +51,14 @@ public:
std::string option;
std::string argument;
ParsedOption() :
ParsedOption() :
key(-1),
option(),
argument()
{}
ParsedOption(int key_, const std::string& option_, const std::string& argument_) :
key(key_),
key(key_),
option(option_),
argument(argument_)
{}
......@@ -73,11 +73,11 @@ public:
private:
std::string programm;
typedef std::vector<Option> Options;
Options options;
public:
public:
typedef std::vector<ParsedOption> ParsedOptions;
ArgParser();
......@@ -86,17 +86,17 @@ public:
ArgParser& add_text(const std::string& doc);
ArgParser& add_pseudo(const std::string& left, const std::string& doc);
ArgParser& add_newline();
ArgParser& add_option(int key,
char short_option,
const std::string& long_option,
const std::string& long_option,
const std::string& argument,
const std::string& help,
bool visible = true);
ParsedOptions parse_args(int argc, char** argv);
void print_help(std::ostream& out) const;
bool next();
int get_key();
std::string get_argument();
......
/*
** Xbox360 USB Gamepad Userspace Driver
** Copyright (C) 2010 Ingo Ruhnke <grumbel@gmx.de>
** Copyright (C) 2010 Ingo Ruhnke <grumbel@gmail.com>
**
** 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
......@@ -33,8 +33,8 @@
#include "axisevent/rel_repeat_axis_event_handler.hpp"
AxisEventPtr
AxisEvent::invalid()
{
AxisEvent::invalid()
{
return AxisEventPtr();
}
......@@ -51,7 +51,7 @@ AxisEvent::create_rel(int device_id, int code, int repeat, float value)
{
return AxisEventPtr(new AxisEvent(new RelAxisEventHandler(device_id, code, repeat, value)));
}
AxisEventPtr
AxisEvent::from_string(const std::string& str)
{
......@@ -61,7 +61,7 @@ AxisEvent::from_string(const std::string& str)
const std::string& token = str.substr(0, p);
std::string rest;
if (p != std::string::npos)
if (p != std::string::npos)
rest = str.substr(p+1);