Git Product home page Git Product logo

controllerbuddy's Introduction

ControllerBuddy

ControllerBuddy Logo

ControllerBuddy Release Status

Check out the ControllerBuddy Homepage for getting started.
For further support join the ControllerBuddy Discord.

Description

ControllerBuddy is a highly advanced gamepad mapping software, which supports the creation of input profiles for complex target applications such as flight simulators.

In addition to the simplistic mapping of buttons and axes of a physical game-controller to keyboard and mouse input, ControllerBuddy also supports the feeding of input commands to a virtual joystick device (vJoy / uinput).

ControllerBuddy's goal is to enable the user to control target applications solely via a gamepad and not having to reach for a keyboard or mouse at any point in time.

Download and Installation

Tip: Check out the ControllerBuddy-Install-Script, it automates all the steps below and much more!

Windows x86-64

  1. First ensure you have correctly installed vJoy on your system.
  2. Click here and download the latest build of ControllerBuddy for Windows as a ZIP archive.
  3. Extract the ControllerBuddy directory from the archive to any desired location on your hard-drive.
  4. Run ControllerBuddy.exe inside the extracted ControllerBuddy directory.

Linux x86-64

  1. First ensure you have installed libsdl2 on your system:
    • Debian / Ubuntu: sudo apt-get install libsdl2-2.0
    • Red-Hat-based: sudo yum install SDL2
    • Arch Linux: sudo pacman -S sdl2
  2. Configure uinput and hidraw:
    1. Create an uinput group: sudo groupadd -f uinput
    2. Add yourself to the group: sudo gpasswd -a "$USER" uinput
    3. As root, create a file /etc/udev/rules.d/99-input.rules with the following content:
      KERNEL=="uinput", SUBSYSTEM=="misc", MODE="0660", GROUP="uinput"
      KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="05c4", MODE="0666"
      KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="09cc", MODE="0666"
      KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="0ba0", MODE="0666"
      KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="0ce6", MODE="0666"
      
    4. As root, create a file /etc/modules-load.d/uinput.conf with the following content:
      uinput
  3. Reboot
  4. Click here and download the latest build of ControllerBuddy for Linux as a TGZ archive.
  5. Extract the ControllerBuddy directory from the archive to any desired location on your hard-drive.
  6. Run ControllerBuddy inside the extracted ControllerBuddy/bin directory.

Features

  • Maps gamepad axes and buttons to highly customizable actions:
    • vJoy axis movements (absolute and relative)
    • vJoy button presses
    • Keyboard inputs
    • Mouse inputs
    • Cycles of actions
    • Mode switching
    • etc.
  • Powerful user interface:
    • Allows the creation of mapping profiles
    • Configuration of settings
    • Support for a light and dark UI theme
  • In-game overlay:
    • Displays currently active mode
    • Can display current position of virtual axes
    • On-Screen-Keyboard that can be controlled via gamepad
    • VR support (OpenVR)
    • Customizable position and colors
  • Two scenarios of operation:
    • Local
    • Server to client (experimental! use only in trusted networks!)
  • Supported gamepads:
    • Xbox 360 Controller
    • Xbox One Controller
    • Xbox Series X|S Controller
    • Dual Shock 3
    • Dual Shock 4
    • Dual Sense
    • etc. (to check if your controller is supported please refer to the SDL_GameControllerDB project)
  • Supported operating systems:
    • Windows / Linux (local / client / server)
    • macOS (only server - no binaries provided!)
  • Language support for:
    • English
    • German

Profiles

Profiles are used to configure your gamepad for a certain target application.
A profile has the following general structure:

Profile (.json file)
├── Default Mode
│   ├── X Axis
│   │   ├── some Action
│   │   └── another Action
│   ├── Y Axis
│   │   └── some Action
│   ├── A Button
│   │   ├── some Action
│   │   └── another Action
│   ├── B Button
│   │   └── Switch Mode Action (switches to 'Another Mode' and back)
│   ├── X Button
│   │   └── Switch Mode Action (switches to 'Yet another Mode' and back)
│   └── Y Button
│       └── Cycle Action (performs 'Action 1', when pressed again 'Action 2', then 'Action 3', then starts over)
│           ├── Action 1
│           ├── Action 2
│           └── Action 3
├── Another Mode
│   ├── X Axis
│   │   └── some Action
│   └── A Button
│       └── some Action
└── Yet another Mode
    └── X Axis
        └── some Action

When switching from one Mode to another, all the axes and buttons that are not used by the other mode retain their function from the previous mode. This works over multiple levels of Modes.

Mode switching can be configured to operate in two different ways:

  • Default: works like the SHIFT key on your keyboard
  • Toggle: works like the Caps Lock key

A set of well-thought-out profiles for the most popular flight simulators are available in the ControllerBuddy-Profiles repository.

Architecture

Local mode:

            Local:

     Physical Controller
              |
              |
              v
       ControllerBuddy
       |             |
       |             |
       v             v
vJoy / uinput   Win32 / X11
      |                |
      |                |
      v                v
      Target Application

Server-Client mode:

             Server:                                 Client:

       Physical Controller
                |
                |
                v                  UDP
         ControllerBuddy  -------------------->  ControllerBuddy
                                                 |             |
                                                 |             |
                                                 v             v
                                          vJoy / uinput   Win32 / X11
                                                |                |
                                                |                |
                                                v                v
                                                Target Application

Example Screenshots

Modes Tab

Assignments Tab

Component Editor - Button

Component Editor - Axis

Dark Mode

Visualization Tab

Overlay

VR Overlay

Command Line Parameters

Parameter Arguments Description Available for scripting
-autostart local / client / server starts the specified mode of operation after launch yes
-export file destination exports a visualization of the current profile to the specified path yes
-help prints the help and exits no
-profile file source loads the specified profile after launch yes
-gamecontrollerdb file source adds the SDL controller mappings from the specified file yes
-quit quits the application yes
-save file destination save the current profile to the specified path yes
-skipMessageDialogs skips all message dialogs no
-tray launches the application in the system tray yes
-version prints the version information and exits no

If an instance of ControllerBuddy is already running, launching a second instance with the parameters denoted as "available for scripting" will trigger the corresponding action in the first instance and immediately shutdown the second instance.

This can be used to integrate ControllerBuddy into third party applications.
For more information please check out ControllerBuddy-DCS-Integration, an exemplary integration of ControllerBuddy into DCS World.

Attribution

ControllerBuddy uses the following awesome software technologies and libraries:

Building

If you want to build ControllerBuddy from its source code this section might be helpful to get you started.
ControllerBuddy uses the Gradle build system, the following Gradle tasks are supported:

Task Command
Generate version source file gradlew generateVersion
Run SpotBugs and Spotless gradlew check
Apply Spotless formatting gradlew spotlessApply
Run ControllerBuddy gradlew run
Install a jpackage image gradlew installDist
Create a ZIP-compressed jpackage image gradlew distZip
Create a TGZ-compressed jpackage image gradlew distTar
Delete build and gen directories gradlew clean

License Information

GNU General Public License v3.0

controllerbuddy's People

Contributors

bwravencl avatar dependabot[bot] avatar sa-matteohausner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

controllerbuddy's Issues

Use the Java Platform Module System (JPMS)

A long term goal is to use the Java Platform Module System (JPMS) and move ControllerBuddy itself and all its dependencies onto the module path in order to let jlink produce a minimal runtime automatically.

Unfortunately as of right now the JPMS is still not at all or badly supported by some of ControllerBuddy's dependencies and the toolchain:

  • Eclipse still has major issues parsing the module-info.java of multi-release JARs (bug)
  • Two JARs on which batik-swing depends on (batik-script and xalan) cannot be placed on the module path (bug)

The jpms branch contains the necessary modifications and workarounds to use JPMS.
However until at least the Eclipse issue is fixed using JPMS is out of the question.

Since jlink requires us to move ALL dependencies onto the module path in order to take advantage of the JPMS there are currently no benefits in doing the switch. Also we currently already configure jlink manually to produce a minimal runtime.

JNA has extra packages with a module.info: https://github.com/java-native-access/jna/blob/master/www/FrequentlyAskedQuestions.md#does-jna-publish-a-module-descriptor-module-infojava-to-support-the-java-module-system-jpms

Linux client-support

Add support for fullscreen Vulkan overlay

Fullscreen overlays for Direct3D and OpenGL applications are implemented for Windows x64 in the mumble-overlay branch by hijacking the Mumble Overlay.
With more and more applications using Vulkan it would be nice to support overlays for these applications as well.

Initial research shows that "validation layers" are the technology a fullscreen overlay for Vulkan should be based on.

Link collection:

Add support for OpenXR overlay

macOS: controllers already connected on startup are not recognized

On macOS controllers which are already connected before ControllerBuddy is launched are not recognized.

This issue appeared with the switch to LWJGL 3.3.0.

The root cause of the issue is that (unlike on other platforms) glfwJoystickPresent() is not called from the main thread on macOS. This is deliberate, because GLFW and AWT are fundamentally incompatible on macOS (macOS internals require both of them to run on the first thread).

Before LWJGL 3.3.0 - even though out of spec - it was possible to call glfwJoystickPresent() from other threads than the main thread and still get a correct result. With 3.3.0 the call always returns ˋfalseˋ.

A potential solution is mentioned here: LWJGL/lwjgl3#697 (comment)

A workaround is to unplug the controller and plug it back in after launching ControllerBuddy, since the callback registered via glfwSetJoystickCallback() works correcty.

Linux: Haptic feedback support for Xbox Controllers

On Windows support for haptic feedback (and battery state retrieval) is performed via XInput.

Since XInput is not available on Linux and general haptic feedback support via glfw is not yet there - see glfw/glfw#57 a HID driver for Xbox 630 and Xbox One / Series X|S controllers should be implemented for Linux.

SDL should be a good reference for this (they support Xbox controllers, via Raw Input, XInput and HID).

There is no controller connected. Without a controller ControllerBuddy can only be used in client-mode.

Hi there,

I am working through the setup of ControllerBuddy and have downloaded and configured vjoy per the "getting started" Youtube video. I am trying to use an Xbox One controller, which my computer (Windows 10) recognizes and tests as expected with "Set up usb game controllers" in the control panel.

Also, I saw a previous issue thread with the same issue (they hadn't read carefully and didn't have a controller connected) where you requested the temp ControllerBuddy.log file. From my directory C:\Users\username\AppData\Local\Temp here is the ControllerBuddy log file: ControllerBuddy.log

Please advise if you have any suggestions as to what the source of the issue could be.

Thanks!

KP

"There is no controller connected."

Hello. I'm trying to run ControllerBuddy 0.12.34 on Windows 10 with vJoy v2.1.9 installed, but when I run it I get the "There is no controller connected. Without a controller ControllerBuddy can only be used in client-mode." message. There is one device in vJoy configuration and examples that come with it seem to work Ok (feeder/monitor programs). I've tried adding another device and resetting devices in configuration, but nothing changed. What could be the problem?

Pause key toggles NumLock state

ToKeyActions with the "Pause" key code (DIK 0xC5) toggle the NumLock state.
This seems to be some qurik in how this particular key code is handled by SendInput(), as it is not triggered by VJoyOutputThread.setLockKeyState().

Only physical controllers supported?

I need to send data over network from one instance of FreePIE (https://andersmalmgren.github.io/FreePIE/) to another. As FreePIE supports writing to vJoy, I have figured I will feed data to one vJoycontroller on one end, send it over with ControllerBuddy and then recover it from vJoy on the other end.

However, when I start ControllerBuddy on the 'sender' computer, it says that no controller is connected (i.e. it does not detect the vJoy controller)... Is it only for physical controllers? I realize that it might be done on purpose (to avoid endless loops), but there might be other ways around that...

Linux: Lock keys do not work as expected on XWayland

When running on Wayland (via XWayland) changes to the state of lock keys (Caps-Lock, Num-Lock, Scroll-Lock) are not propagated as desired.
It seems reading and modifying a lock key state works only when ControllerBuddy itself has the focus.

Further investigation is needed...

Switch from Pure Java HID-API to hid4java

Since Pure Java HID-API seems to be pretty much abandonned and requires a number of workarounds in order to work correctly, switching to an alternative HID library remains a medium term goal.

Fortunately hid4java which is based on hidapi got recently resurrected from the dead.

The hid4java branch contains all necessary changes required to do the switch and works fine on Windows.

Unfortunately hidapi currently does not allow opening a device in non-exclusive mode on macOS which blocks the switchover: libusb/hidapi#27

Once the issue is fixed and there is a build of hid4java based on an updated hidapi version, switching is possible.
An alternative would be to build custom versions hidapi and hid4java with the following patch: signal11/hidapi#297

Issue with pause key events

There seems to be some strange difference between the keyboard events generated by ControllerBuddy and the Windows OSK concerning the Pause key.

Generally the Pause key seems to work just fine, however e.g. in DCS a combination of Right CTRL + Pause is not handled correctly, although seems to get detected correctly by the DCS internal input mapper.

It seems this issue can be replicated with the following tool: https://w3c.github.io/uievents/tools/key-event-viewer.html

When pressing the Pause key via ControllerBuddy the tool detects an "unrecognized key".
Pressing the key via the Windows OSK the site shows "Pause".
The behaviour does not "improve" when the KEYEVENTF_EXTENDEDKEY flag is not set.

Haptic feedback support for Steam Controllers

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.