GithubHelp home page GithubHelp logo

hurricanepootis / sdl-jstest Goto Github PK

View Code? Open in Web Editor NEW

This project forked from grumbel/sdl-jstest

0.0 0.0 0.0 195 KB

Simple SDL joystick test application for the console

License: GNU General Public License v3.0

C 76.40% Nix 9.53% CMake 8.45% Roff 5.63%

sdl-jstest's Introduction

sdl-jstest

sdl-jstest and sdl2-jstest are simple programs that lets you find out how many joysticks SDL or SDL2 detected on your system, how many axes, buttons, hats and balls they have each. They also lets you test the joysticks by displaying the events they send or by displaying their current button, axis, hat or ball state. sdl-jstest is especially useful if you want to test your SDL_LINUX_JOYSTICK configuration.

Screenshots

sdl-jstest 0.2.1

Requirements

sdl-jstest requires the following packages to build:

  • cmake
  • libsdl1.2-dev
  • libsdl2-dev
  • libncurses5-dev

Submodules

To fetch submodule dependencies:

git submodule init
git submodule update

Compilation

To compile type:

mkdir build
cd build
cmake ..
make

To install (optional):

make install

The DESTDIR and PREFIX can be configured as follows:

make install DESTDIR=/tmp/pingus

cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/usr

Cross-compilation to Win32

MXE (http://mxe.cc) is needed. Follow its installation instructions, but you can build it with just the needed packages for sdl-jstest:

make gcc cmake sdl sdl2 ncurses pdcurses

This still takes quite a while.

After MXE installation finishes, for sdl-jstest compilation type:

mkdir build
cd build
i686-w64-mingw32.static-cmake ..
make

Configuration

The SDL behaviour of what axis is treated as a hat and which as normal axis can be configured with the environment variable SDL_LINUX_JOYSTICK:

  • ftp://ptah.lnf.kth.se/pub/misc/sdl-env-vars

SDL_LINUX_JOYSTICK: Special joystick configuration string for linux. The format is "name numaxes numhats numballs" where name is the name string of the joystick (possibly in single quotes), and the rest are the number of axes, hats and balls respectively.

A simple example would be:

$ export SDL_LINUX_JOYSTICK="'Xbox Gamepad (userspace driver)' 6 0 0"

Which makes all axis be handled as normal axis and none as hat, as most games don't use hats.

sdl-jstest's People

Contributors

grumbel avatar orbea avatar bentley avatar protocultor avatar ghostlydark avatar marxjohnson avatar ulidtko avatar stuaxo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.