genemecija / learn-morse-code

Web app for learning Morse code.
https://genemecija.github.io/learn-morse-code/
14 stars 6 forks source link

Mode B #1

Closed AshleyF closed 2 years ago

AshleyF commented 2 years ago

Wonderful site! Any chance of implementing Mode B for paddle input?

Also, how do I build this project (so that I may implement this myself)?

genemecija commented 2 years ago

I'm really glad you enjoy it! I built it as a tool to help me practice keying, but I've always wondered if anyone else found it useful!

Unfortunately, I don't currently have the cycles to implement this functionality, but if you want to fork and edit the code, I'd gladly merge a pull request with that functionality.

Truth be told, it's been at least a couple years since I worked on this, but if memory serves me correctly, the places you'd want to add the functionality are in the useElectronicKey.js and useStraightKey.js files in the /src/hooks folder, and KeyTypePicker.js in the /src/components folder.

An idea to go about this would be to add a "Mode" toggle/switch/checkbox in the KeyTypePicker component to switch between Mode A/B, which state would need to precipitate to the useElectronicKey and useStraightKey hooks. These hooks are where the Mode B functionality would need to be added and enabled/disabled based on the state of the Mode toggle.

If you want to build this project locally, I believe you can just clone the repo and run npm start from within the /src/ directory.

Hopefully I've remembered this correctly. 🤞

AshleyF commented 2 years ago

Thanks much for the quick reply! I got this working and did a PR.

genemecija commented 2 years ago

PR was merged. Thanks for your contribution!