Skip to content

Add support for gamepad controls on flash cards#100

Merged
mreichhoff merged 2 commits intomainfrom
gamepad-for-some-reason
Aug 16, 2025
Merged

Add support for gamepad controls on flash cards#100
mreichhoff merged 2 commits intomainfrom
gamepad-for-some-reason

Conversation

@mreichhoff
Copy link
Owner

This allows you to connect a controller (e.g., switch pro) and use it to perform flash card actions. A/B (since xbox and switch differ) flip the card, Y/X plays the audio, and R/L (RB/LB) mark right or wrong, respectively.

This is quite silly but why not. It's kinda nice to do flashcards this way. This change also adds a keyboard shortcut to play audio.

It's rather unfortunate that the web platform doesn't have button events for gamepads like for keyboards, but I tried to mimic it with a simple state machine and custom events.

This allows you to connect a controller (e.g., switch pro) and use it
to perform flash card actions. A/B (since xbox and switch differ) flip
the card, Y/X plays the audio, and R/L (RB/LB) mark right or wrong,
respectively.

This is quite silly but why not. It's kinda nice to do flashcards
this way. This change also adds a keyboard shortcut to play audio.

It's rather unfortunate that the web platform doesn't have button
events for gamepads like for keyboards, but I tried to mimic it
with a simple state machine and custom events.
@github-actions
Copy link

github-actions bot commented Aug 16, 2025

Visit the preview URL for this PR (updated for commit 4f5240d):

https://hanzigraph--pr100-gamepad-for-some-rea-y8i039w2.web.app

(expires Sun, 17 Aug 2025 17:31:51 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: dbfc59c053d815dc5dedbd48d2959ec4a33d1b39

@mreichhoff mreichhoff merged commit 9681bbe into main Aug 16, 2025
2 checks passed
@mreichhoff mreichhoff deleted the gamepad-for-some-reason branch August 16, 2025 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant