Code Monkey home page Code Monkey logo

axisfix's Introduction

AxisFix

This project tries to fix the axis problem found when using some PlayStation to USB adapters to play games that use DDR (Dance Dance Revolution) mats. There is already a solution for Windows using AutoHotKey, but there appears to be no simple alternative for Linux.

The Problem

Some DualShock to USB adapters have a problem where d-pad buttons are reported as analog axis, and so when playing DDR-like games (StepMania, for instance) you come to the problem where you can't press two opposing directions at the same time, as there is no way to do that on an analog stick.

Available solutions

On Windows, there is an AutoHotKey based solution which reads the axis position and based on small differences on the axis values, simulates keyboard input. AHK is not available for Linux, so this is not an option.

There is a solution for Linux which involves patching the joystick kernel module (https://github.com/adiel-mittmann/dancepad) but doing that isn't really that intuitive and also relies on patching code that runs in kernel space.

This tool

I wrote this tool to solve the problem presented above. It uses the same idea the AHK one uses, watching the joystick's input and simulating keyboard key presses as the 'correct' input to StepMania.

There are 2 modes, config and fix. The config mode serves as a Wizard of sorts to create the .ini configuration file the tool accepts. fix mode takes a configuration file and starts running the algorithm that takes pad input and converts it to key strokes.

Compiling

To compile this program, you can just run make on the root folder. If you want it to produce debug messages, then run make debug inside the src/ directory.

Requirements

I think all you need is to have a recent kernel, since the joystick and uinput modules aren't all that new (to my knowledge).

This tool depends on no dynamic libraries.

License

Unless stated otherwise in the file (such as in ini.*), the code in this repository is released under an MIT-like license. Check LICENSE for more information.

This tool uses the INIH library, available at https://github.com/benhoyt/inih all credit for ini.h and ini.c should go to their creator and not me.

axisfix's People

Contributors

jose1711 avatar leoagomes avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

axisfix's Issues

Getting a segmentation fault when running fix mode

I'm able to generate a config fine but soon as I try to run in fix mode I get a segmentation fault. Everything is up to date, I tried to build again from source to get debug messages but nothing is logged. After adding some debug statements of my own and recompiling, it seems to throw the segmentation fault in the read_pad_data() method.

I'll attach my pad.ini file maybe it is exceeding the size limit for the struct or something?
pads.ini

Arrow keys sticking

Hey first off thanks for this fix! Amazing work!

Using this on a rpi4 with a konami ps3 dance pad to solve for the axis fix. One thing I've come across while using this program is that the arrow keys seem to stick. So if I have it mapped to the "wasd" form, then when I press on an arrow and take it off, it acts like I'm still holding down on the pad and prints many "w", "a", "s", or "d" characters to the screen.

Also one more issue is the mapping seems to be backwards (wasn't sure if this was due to the code or the way the pad interprets it). I just map the buttons in reverse when running config and it's fine but just wanted to let you know. Thanks!

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.