Skip to content

Repository files navigation

MorseClickParser

A desktop application for encoding and decoding Morse code through an interactive GUI. Built with C# and Avalonia, this application supports French characters and provides a click-based interface to translate between text and Morse code.

🎯 Features

  • Morse Code Decoding: Translate Morse sequences back to text
  • French Language Support: Complete support for French accented characters (À, É, È, Ê, Ï, Ô, Ü, Ù, Æ, Ç)
  • Interactive GUI: User-friendly Avalonia-based desktop interface
  • Real-time Click Interaction: Press and hold button to create Morse code sequences
  • Comprehensive Character Set:
    • All letters A-Z
    • Numbers 0-9
    • Punctuation marks and special characters
    • Space and slash separators

🚀 Getting Started

Prerequisites

  • .NET 10.0 or later
  • Windows, macOS, or Linux (Avalonia is cross-platform)

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/MorseClickParser.git
cd MorseClickParser
  1. Restore dependencies:
dotnet restore
  1. Build the project:
dotnet build
  1. Run the application:
dotnet run --project MorseClickTranslator/MorseClickTranslator.csproj

📖 How to Use

GUI Interface

  1. Click Mode (Interactive):

    • Press and hold the "Morse Button" for a dot (.)
    • Press and hold for a longer duration for a dash (-)
    • Release to register the input
    • Use "Clear" button to reset
  2. Timing Thresholds:

    • Character Wait: 200ms (time before character completes)
    • Translation Wait: 800ms (time to process Morse sequence)
    • Space Wait: 2000ms (time to register word space)

🏗️ Project Structure

MorseClickParser/
├── MorseClickTranslator/
│   ├── Morse.cs                    # Core Morse encoding/decoding logic
│   ├── MainWindow.axaml.cs         # UI window with event handlers
│   ├── MainViewModel.cs            # MVVM ViewModel for the application
│   ├── App.axaml.cs               # Application entry point
│   ├── Program.cs                  # .NET entry point
│   ├── Languages/
│   │   └── FrenchDictionary.cs    # Morse dictionary with French support
│   └── MorseClickTranslator.csproj # Project configuration
├── MorseClickTranslator.Tests/     # Unit tests (coming soon)
├── MorseClickTranslator.sln        # Solution file
└── README.md                        # This file

🔧 Core Components

Morse.cs

The heart of the application containing:

  • Decode(string encodedText): Converts Morse code to text
  • Encode(string rawString): Converts text to Morse code
  • Timing constants for click detection

FrenchDictionary.cs

Dictionary mapping characters to Morse code sequences:

  • Basic Latin letters
  • French accented characters
  • Numerals 0-9
  • Punctuation and special characters

MainViewModel.cs

MVVM ViewModel managing:

  • Button press/release commands
  • Morse code sequence tracking
  • Timing and state management

MainWindow.axaml.cs

Avalonia UI window handling:

  • Button event bindings
  • Pointer press/release interactions
  • UI rendering

🧪 Testing

Run the test suite:

dotnet test

📚 Morse Code Reference

Letter Code Letter Code
A .- N -.
B -... O ---
C -.-. P .--.
D -.. Q --.-
E . R .-.
F ..-. S ...
G --. T -
H .... U ..-
I .. V ...-
J .--- W .--
K -.- X -..-
L .-.. Y -.--
M -- Z --..

Numbers: 1 (.----|) through 0 (-----) follow the pattern of increasing dashes.

French Characters:

  • À, Â: .--.-
  • É, Ë: ..-.
  • È: .-..-
  • Ê: -..-
  • Ç: -.-.
  • And more...

🛠️ Technologies Used

  • Language: C# (.NET 10.0)
  • UI Framework: Avalonia 11.3.12
  • MVVM Toolkit: Community Toolkit MVVM 8.4.2

📄 License

MIT License

👤 Author

ImRadegast

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📝 Notes

  • The application uses click duration to distinguish between dots and dashes
  • French language support is built-in and can be extended with additional languages
  • The UI is responsive and works on multiple platforms thanks to Avalonia

🔮 Future Enhancements

  • Morse code learning mode with a clicker-type Game
  • Support for additional languages (German, Spanish, Italian, etc.)
  • Audio output for Morse code (beeps and tones)
  • Import/export Morse code to text files
  • Customizable timing thresholds

Happy Morse learning! 📡

About

A desktop application for encoding and decoding Morse code through an interactive GUI. Built with C# and Avalonia, this application supports French characters and provides a click-based interface to translate between text and Morse code.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages