You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

svelte-gamepad-virtual-joystick

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-gamepad-virtual-joystick

Svelte library for complex input to your app, provides Gamepad integration with different UI-interfaces: - **Button** A button that can either be pressed by touch or mouse, a key on the keyboard or a button on your gamepad - **Joystick** A joystick with

1.0.7
latest
npmnpm
Version published
Weekly downloads
479
-18.26%
Maintainers
1
Weekly downloads
 
Created
Source

Svelte Gamepad and virtual JoyStick

Svelte library for complex input to your app, provides Gamepad integration with different UI-interfaces:

  • Button A button that can either be pressed by touch or mouse, a key on the keyboard or a button on your gamepad
  • Joystick A joystick with X/Y axes that can be controlled by touch/mouse input, an analog stick of your gamepad or keyboard buttons

The virtual Joystick can either be used as fallback when a real gamepad is not connected but a touchscreen is present, as indicator of the gamepad state or to provide a virtual joystick to the user.

Provides custom focus and context management.

Examples

See the +page.svelte file for a basic demo.

Take a look at SMUI Gamepad Components for an integration into Svelte Material UI

Application

This library is used to reimagine the control of robotic systems but can also be useful in web game development prototyping.

Installation

This library can be installed using npm:

npm i -D svelte-gamepad-virtual-joystick

Sources

based on code from

  • https://github.com/arturcarvalho/svelte-gamepad/ (I first thought to just use it and updated to use vite and integrate more complex button/axis handling but I also wanted to support more than 4 gamepads, have a virtual joystick and keyboard controls so this became its own thing instead of just a fork)
  • nipple.js (nipple.js itself is not svelte compatible because it directly accesses window)

Deploy to NPM

TODO!

License

BSD-3

FAQs

Package last updated on 07 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.