Skip to content

Repository files navigation

Droidpad gamepad

Simple server that lets you use DroidPad as a game controller on Linux and Windows.

It currently supports:

  • WebSocket transport
  • Bluetooth RFCOMM transport
  • Linux virtual controller output through evdev
  • Windows output through ViGEmBus by default
  • Windows vJoy backend
  • Double-tap-to-hold button handling

Requirements

  • rust

Windows

  • ViGEmBus for the default backend
  • vJoy for the vjoy backend

Linux

Common / CLI

  • pkg-config (build time)
  • libevdev
  • dbus
  • BlueZ (for Bluetooth transport)

UI (Additional dependencies)

  • libayatana-appindicator
  • gtk3
  • vulkan-loader
  • wayland / libX11
  • libxkbcommon
  • fontconfig / freetype
  • openssl
  • alsa-lib
  • xdotool (for tray functionality)
  • curl
  • glib / gdk-pixbuf / atk / pango
  • libGL

Virtual Controller Permissions (udev)

To allow Droidpad to create a virtual controller without running as root, you need to install the provided udev rule:

sudo cp res/99-droidpad-gamepad.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules && sudo udevadm trigger

Running

droidpad-gamepad

The server listens on port 1715 by default.

Useful cli options

droidpad-gamepad --port 1715
droidpad-gamepad --double-tap-timing 200 --double-tap-postfix _dth

Transports

WebSocket is the default transport:

droidpad-gamepad --transport ws

Bluetooth uses RFCOMM:

droidpad-gamepad --transport bluetooth

On Linux you can also choose the RFCOMM channel:

droidpad-gamepad --transport bluetooth --bt-channel 3

Windows backends

ViGEmBus is the default backend.

To select the vJoy backend at runtime on Windows:

droidpad-gamepad --backend vjoy --vjoy-device 0

Packages

Flatpak

You can build and run Droidpad Gamepad as a Flatpak.

Prerequisites

  • flatpak
  • flatpak-builder

Building

flatpak remote-add --user --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
flatpak-builder --user --install --install-deps-from=flathub --force-clean build flatpak/io.github.tofixrs.droidpad-gamepad.yaml

If you are using the Nix devShell, you can simply run:

flatpak-build

Running

flatpak run io.github.tofixrs.droidpad-gamepad

Nix

Flake

{
  inputs = {
    droidpad-gamepad = {
     url = "git+https://github.com/Tofixrs/droidpad-gamepad.git";
     inputs.nixpkgs.follows = "nixpkgs";
    }
  };
}

Cachix

# cachix
{
  nix.settings = {
    substituters = ["https://tofix-cache.cachix.org"];
    trusted-public-keys = ["tofix-cache.cachix.org-1:myU8xgZK0u4kkBPCBAlLH/8wCzw5Gn6OYpit6OsAhjU="];
  };
}

NixOS Module

You can use the provided NixOS module to install the package and automatically set up the udev rules.

{ inputs, ... }: {
  imports = [ inputs.droidpad-gamepad.nixosModules.default ];
  services.droidpad-gamepad.enable = true;
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages