diff --git a/.github/on-release.yml b/.github/workflows/on-release.yml similarity index 100% rename from .github/on-release.yml rename to .github/workflows/on-release.yml diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..dab2228 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,55 @@ +# Contributing + +# Quick start +`npm install` +`npm run watch` + +Then open `http://localhost:5001/testdata`. + +# Running against fightcade + +To launch Fightcade2 (an Electron app) and be able to run the developer tools, run: +``` +/Applications/FightCade2.app/Contents/MacOS/Fightcade2 --remote-debugging-port=8315 +``` + +I downloaded all the pages manually, so that developing is faster. +Also added an import to `inject.js`, ideally we would use https://github.com/tapio/live-server/issues/338 instead + +To test I symlink +``` +ln -s /Users/eduardo/projects/keyboard-navigation-playground/inject.js /Applications/FightCade2.app/Contents/Resources/app/inject/inject.js +``` + +# Testing +There are playwright tests under the `tests` directory. They test the static HTML files, +which are faster in most cases, but ideally we would test against a real Fightcade instance. + +# Recipes + +## Debugging the application on steam deck + +1. Create a `Fightcade_debug.desktop` file +``` +!/usr/bin/env xdg-open +[Desktop Entry] +Version=1.0 +Type=Application +Terminal=false +Exec=/home/deck/Documents/Fightcade/Fightcade2.sh --remote-debugging-port=8315 +Name=Fightcade Debug +Comment=Fightcade +Categories=Game;Emulator;ArcadeGame +Icon=/home/deck/Documents/Fightcade/fc2-electron/resources/app/icon.png +~ +``` + +2. Open desktop mode, open fightcade_debug + +3. Make a ssh tunnel (from your pc) + +``` +ssh -L 8315:localhost:8315 deck@steamdeck +``` + +4. Open `http://localhost:8315` in chrome diff --git a/README.md b/README.md index b10ed29..479afc9 100644 --- a/README.md +++ b/README.md @@ -1,100 +1,38 @@ -# Fightcade Keyboard Navigation +# Fightcade Gamepad Navigation -The objective is to be able to control the FightCade frontend (not the emulator part, -like setting Inputs, since that's too hard), -entirely with a Arcade Stick. +Control the [Fightcade](https://www.fightcade.com/) frontend with a gamepad (or a keyboard). -The approach is to make everything more keyboard accessible, and then translate the stick -controls into keyboard events. +https://github.com/eh-am/fightcade-gamepad-navigation/assets/6951209/40c2b094-30bb-4f95-9e02-0f6e204baed9 -# Meta -To run Fightcade2 (an Electron app) and be able to run the developer tools, run: -``` -/Applications/FightCade2.app/Contents/MacOS/Fightcade2 --remote-debugging-port=8315 -``` +# Motivation +I have Steam Deck docked and plugged to a TV and an [Arcade Stick](https://www.8bitdo.com/arcade-stick/), +so I wanted to control the Fightcade frontend with only the stick, without requiring a keyboard/mouse. -I downloaded all the pages manually, so that developing is faster. -Also added an import to `inject.js`, ideally we would use https://github.com/tapio/live-server/issues/338 instead +# How to use +## Installation +Download the latest Release. -To test I symlink -``` -ln -s /Users/eduardo/projects/keyboard-navigation-playground/inject.js /Applications/FightCade2.app/Contents/Resources/app/inject/inject.js -``` +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/` +## Running +Open Fightcade, then press any button for the plugin to recognize the controller, +a notification message should tell the controller has been recognized. -# TODO: -- [ ] login page -- [ ] search page, hidden gems is not working -- [ ] when focusing manually, set scroll into -- [ ] handle asynchronousness, ex when a lobby is added to the sidebar -- [ ] inject custom js, like the