Control the Fightcade frontend with a gamepad (or a keyboard).
fightcade-720.mp4
I have Steam Deck docked and plugged to a TV and an Arcade Stick, so I wanted to control the Fightcade frontend with only the stick, without requiring a keyboard/mouse.
Download the latest Release.
Then copy the inject.js
app to "INJECT_JS_PATH", which depends on the OS/way of installation:
- On steam deck (no flatpak), it's under
/home/deck/Documents/Fightcade/fc2-electron/resources/app/inject/
- On a mac, it's under
/home/deck/Documents/Fightcade/fc2-electron/resources/app/inject/
Open Fightcade, then press any button for the plugin to recognize the controller, a notification message should tell the controller has been recognized.
Then navigate with the D-pad (or equivalent). By default, BUTTON_1 is translated to "Enter", and SHOULDER_LEFT and SHOULDER_RIGHT to Shift+Tab and Tab, respectively.
- It only handles the frontend, ie not the emulators part. So initial setup for the inputs still requires a mouse/keyboard.
- It relies on the DOM structure, so if it ever changes, it will break and require updates. PRs welcome :)
The approach is to make everything more keyboard accessible, and then translate gamepad inputs to keyboard events.
- blueminder/fightcade-joystick-kb-controls, for the initial inspiratino
- Controller.js, for handling the gamepad inputs
- ally.js, for helping handling tab navigation and debugging focusable elements