Coder Social home page Coder Social logo

drakehinst / joystickgremlin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from whitemagic/joystickgremlin

1.0 0.0 0.0 21.9 MB

A tool for configuring and managing joystick devices.

Home Page: http://whitemagic.github.io/JoystickGremlin/

License: GNU General Public License v3.0

JavaScript 0.02% Python 87.65% HTML 5.38% QML 6.93% Batchfile 0.02%

joystickgremlin's Introduction

Joystick Gremlin

Introduction

Getting Help: If you have issues running Gremlin or questions on how to make certain things work, the best place to ask for help is in the #joystick-gremlin channel on the HOTAS discord which can be found here https://discord.gg/szqaJE7.

Joystick Gremlin is a program that allows the configuration of joystick like devices, similar to what CH Control Manager and Thrustmaster's T.A.R.G.E.T. do for their respectively supported joysticks. However, Joystick Gremlin works with any device be it from different manufacturers or custom devices that appear as a joystick to Windows. Joystick Gremlin uses the virtual joysticks provided by vJoy to map physical to virtual inputs and apply various other transformations such as response curves to analogue axes. In addition to managing joysticks, Joystick Gremlin also provides keyboard macros, a flexible mode system, scripting using Python, and many other features.

The main features are:

  • Works with arbitrary joystick like devices
  • User interface for common configuration tasks
  • Merging of multiple physical devices into a single virtual device
  • Axis response curve and dead zone configuration
  • Arbitrary number of modes with inheritance and customizable mode switching
  • Keyboard macros for joystick buttons and keyboard keys
  • Python scripting

Joystick Gremlin provides a graphical user interface which allows commonly performed tasks, such as input remapping, axis response curve setups, and macro recording to be performed easily. Functionality that is not accessible via the UI can be implemented through custom modules.

Used Software & Other Sources

Joystick Gremlin uses the following software and resources:

Currently the 32bit version of Python is needed and the following packages should be installed via PiP to get the source running:

Generating the MSI Installer

The job of turning the Python code in a windows executable and packaging everything up into an installable MSI file is performed by pyinstaller and wix. The steps needed to build the code and assemble it into the installer is automated using a batch script and can be run as:

deploy.bat

To simply generate the executable code without the MSI installer the following command can be used:

pyinstaller -y --clean joystick_gremlin.spec

joystickgremlin's People

Contributors

whitemagic avatar drakehinst avatar dixonte avatar jmriego avatar amadeus avatar bryceschmitt avatar moondragon85 avatar

Stargazers

 avatar

joystickgremlin's Issues

[gremlin.code_runner.MergeAxis] Initial self.axis_values causing inconsistent vJoy outputs

Many users are facing an issue with the Merge Axis feature, with inconsistent output values using either merge operations. I am personally using a Thrustmaster T.Flight Rudder Pedals and will be describing the issue for this model specifically, but the issue so far occurred for several other models.

A. Dependencies

  • Branch/Release: Release_13.3_debug
  • Python 3.6.8 environment:
pyinstaller==4.10
pypiwin32==223
PyQt5==5.13.2
reportlab==3.6.8

B. Reproduction steps

  1. Using the Thrustmaster T.Flight Rudder Pedals, configure the Merge Axis as follows:
    • Lower Half: T-Rudder / Y Axis
    • Upper Half: T-Rudder / X Axis
    • Merge Axis: vJoy Device 1 / X Axis
    • Operation: Average
  2. Activate the profile
  3. Open the Input Viewer. In T-Rudder show Axes - Current and in vJoy Device # 1 show Axes - Current.
  4. Before pressing any pedal, the viewer shows:
    • T-Rudder - Axis 1 = 100%
    • T-Rudders - Axis 2 = 100%
    • vJoy Device # 1 - Axis 1 = 0%
  5. Press the right pedal (T-Rudder - X Axis) down as far as it will go.
  6. The viewer now shows:
    • T-Rudder - Axis 1 = -100%
    • T-Rudders - Axis 2 = 100%
    • vJoy Device # 1 - Axis 1 = 50% . However, the expected average value would be [100% - (-100%)] / 2 = 100%, i.e. the maximum forward throttle
  7. Keep the right pedal pressed down, and slightly press the left pedal (T-Rudder - Y Axis). The value of vJoy Device # 1 - Axis 1 jumps (!) from 50% to ~99%, the expected average value.
  8. Keep the right pedal pressed down, and press down the left pedal down as far as it will go. The expected outcome is a standstill of the vehicle.
  9. The viewer now shows:
    • T-Rudder - Axis 1 = -100%
    • T-Rudders - Axis 2 = -100%
    • vJoy Device # 1 - Axis 1 = 0% . This is the expected average value [-100% - (-100%)] / 2 = 0%

C. Workaround

The pedals need to be reset each time after activating a profile by pressing down both pedals before the game is loaded. Otherwise, wrong outputs values will be sent by the merged axis on the vJoy upon the first use in-game. Failure to perform this manual reset may cause, in games like Star Citizen, ship crashes in hangars when pressing the right pedal down (throttle forward) to move forward, then trying to slow down by pressing left pedal down (throttle backward) which makes the throttle suddenly bump up to 100%.

I could reproduce the issue with a Thrustmaster Pendular Rudder, and a Star Citizen streamer using a Thrustmaster T3PA Pro seems to be having the same issue and the same workaround. Similar issues occur when using the other merge operations.

D. Suggested Solution

I could narrow down the issue to the class gremlin.code_runner.MergeAxis, and more specifically in the line responsible for the axis values initialization in __init__():
self.axis_values = [0.0, 0.0]

These values do not match the actual values observed on the axes of the physical rudder before any press on the pedals. For both tested rudder models, the merge would only work if the initial axis values were:
self.axis_values = [1.0, 1.0]

I wrote a plugin that reproduces exactly the behavior of the Merge Axis feature, with initial axes values at 100%, and the issue was solved.

It is possible to solve this issue by adding a field initial_axis_value for each axis of each joystick in the Settings tab and saving these values in the profile, such that they can be given as parameter to the MergeAxis class constructor.

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.