npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

virtual-gamepads

v1.0.0

Published

Virtual gamepads application

Downloads

3

Readme

node-virtual-gamepads - RH Gamestation integration

This nodejs application provides the possibility to use your smartphone as a gamepad controller on Linux OS simply by reaching a local address. You can virtually plug up to 4 gamepad controllers.

Demo

Demo video 1 player in game here

Demo video 3 players on EmulStation here

Prerequisite

This application is only compatible with Linux OS with the uinput kernel module installed.

Installation

git clone https://github.com/pmoran13800/node-virtual-gamepads
cd node-virtual-gamepads
npm install

If you encounter problems while installing or running node-virtual-gamepads have a look at the troubleshooting page.

You can now configure the server to your needs. Just open config.json with the editor of you choice and adjust the values.

  • port: sets the port the web-server is listening on.
  • useGamepadByDefault: if set to false, the / will redirect to a page where one of gamepad, keyboard, or touchpad can be chosen. If set to true, / redirects to the gamepad. The input-selection page can still be accessed via /index.html.
  • analog: if set to true the the above mentioned redirection will append ?analog to the address. This flag will cause the gamepad's d-pad to act like an analog stick instead of d-pad.
  • logLevel: set it to "debug" to get a lot more logging output, to "warning" to only get critical output, or even to "error" if you want to only get errors logged (not recommended).

To start the server run

sudo node main.js

Usage

Once the nodejs application is launched, you just have to plug your gamepad controller by connecting your device on the same local network and by reaching the address http://node_server_address

Features

Plug up to 4 virtual gamepads

The application will plug automatically a new controller when the web application is launched and unplug it at disconnection. 4 slots are available so 4 virtual gamepads can be created. You can see your current slot on the indicator directly on the vitual gamepad.

Virtual gamepad

Use it as standalone application (chrome mobile)

With the add to homescreen chrome feature, you can easily use virtual gamepads application without launching the browser each time you want to play.

With only 3 clicks, virtual gamepads web application becomes a standalone application.

Standalone installation step 1 Standalone installation step 2

Then a shortcut is added on your homescreen and the application will be launched outside the browser.

Virtual gamepad directly from the homescreen Launched outside the browser

Enjoy haptic feedbacks

Because it's difficult to spot the right place in a touch screen without looking at it, the touch zone of each button was increased. LT button was moved at the center of the screen to let as much space as possible for the joystick and avoid touch mistakes.

Step 1

To know if we pressed a button with success, the web application provides an haptic feedback which can be easily deactivated by turning off the vibrations of the phone.

Use the keyboard to enter text

Virtual Keyboard

Use the touchpad for mouse inputs

Virtual Touchpad

An index page lets you choose

Index page

Developing

For developing you will also have to install coffeescript

sudo apt-get install coffeescript

When you changed something in a coffeescript (e.g. main.coffee) run

coffee -c main.coffee

This will compile main.coffee to main.js which than can be run with node (see Installation) To compile all coffee files when ever they change run

coffee -cw .

If you want do add a new keyboard layout please refer to this file.