Skip to content

Latest commit

 

History

History
283 lines (224 loc) · 7.82 KB

File metadata and controls

283 lines (224 loc) · 7.82 KB

User Morse Input Display Added to Training Window

Overview

Added a real-time display showing the Morse code being entered by the user with their paddle, positioned to the right of the statistics in the listening practice mode.

Feature Description

What It Shows

The display shows two pieces of information:

  1. Current Sequence (⚡): The dots and dashes being entered right now (before completion)
  2. Decoded Text (📝): The completed characters that have been decoded

Visual Layout

┌─────────────────────────────────────────────────────────────┐
│  ✓ 5  ✗ 2  📊 71.4%  [Reset]     ⚡ -.-.     📝 HELLO     │
│  └─ Statistics ───────┘            └─ User Input ─────┘    │
└─────────────────────────────────────────────────────────────┘

Left Side: Statistics (correct, wrong, accuracy, reset button) Right Side: User's Morse input (current sequence + decoded text)

Where It Appears

Training Window → Listening Practice Mode

The display appears:

  • In the Listening Practice section (🎧 Listen and Decode)
  • On the same line as the statistics
  • Right-aligned for easy visibility
  • Only visible when there's actual input to show

Display Details

Current Sequence (⚡)

  • Icon: ⚡ (lightning bolt - indicates active input)
  • Shows: Dots (.) and dashes (-) being entered
  • Color: Light blue (cyan)
  • Font: Monospace, 16pt
  • When visible: While building a character (before space/timeout)

Example: When user presses paddle:

⚡ .-     (user is entering "A")
⚡ -.-.   (user is entering "C")
⚡ ...    (user is entering "S")

Decoded Text (📝)

  • Icon: 📝 (memo - indicates completed text)
  • Shows: Completed decoded characters
  • Color: Light green
  • Font: Monospace, 16pt
  • When visible: After characters are decoded

Example: As user completes characters:

📝 H      (decoded "H")
📝 HE     (decoded "H" and "E")
📝 HELLO  (decoded full word)

Combined Display Example

While typing "HELLO":

Statistics area:
✓ 3  ✗ 1  📊 75.0%  [Reset]     ⚡ .-..     📝 HEL

(User is typing "L" - last dot/dash shown in ⚡, 
 "HEL" already completed shown in 📝)

User Workflow

Typical Training Scenario

  1. Play Morse Code: Click "▶ Play Morse Code" button
  2. Listen: Hear the Morse code being played
  3. Send with Paddle: Start sending what you heard
    • As you press paddle: ⚡ .- appears (building character)
    • After timeout: 📝 A appears (character decoded)
    • Continue: ⚡ - then 📝 AT (next character)
  4. Visual Feedback: Always see what you're entering in real-time
  5. Check Answer: Compare your decoded text with correct answer

Benefits

1. Immediate Feedback

  • See exactly what Morse patterns you're sending
  • Catch errors before completing the character
  • Verify correct paddle timing (dit vs dah)

2. Learning Aid

  • Visual confirmation of Morse patterns
  • Helps associate paddle movements with Morse code
  • Reinforces dot/dash patterns for each character

3. Debugging Help

  • Identify if sending wrong patterns
  • See if timing is off (creating wrong characters)
  • Catch accidental extra dits/dahs

4. Confidence Building

  • Real-time confirmation of correct input
  • Reduces anxiety about "did I send it right?"
  • Visual progress indicator during practice

5. Error Detection

  • Spot mistakes immediately
  • Can correct before completing the sequence
  • Learn from visual feedback

Technical Details

Display Logic

// Only shows if there's something to display
if !state.current_sequence.is_empty() || !state.decoded_text.is_empty() {
    // Show current sequence (⚡ .-.)
    if !state.current_sequence.is_empty() { ... }
    
    // Show decoded text (📝 HELLO)
    if !state.decoded_text.is_empty() { ... }
}

Layout Strategy

  • Uses egui::Layout::right_to_left() for right alignment
  • Shares horizontal space with statistics
  • Automatically hides when no input present
  • Vertical stacking for sequence + decoded text

State Sources

  • state.current_sequence: Pulled from MorseDecoder
  • state.decoded_text: Accumulated decoded characters
  • Both updated in real-time during paddle use

Display States

1. No Input Yet

✓ 5  ✗ 2  📊 71.4%  [Reset]
(Right side empty - no input to show)

2. Building First Character

✓ 5  ✗ 2  📊 71.4%  [Reset]     ⚡ .-
(Showing dots/dashes being entered)

3. First Character Decoded

✓ 5  ✗ 2  📊 71.4%  [Reset]     📝 A
(Character completed and decoded)

4. Building Next Character

✓ 5  ✗ 2  📊 71.4%  [Reset]     ⚡ -
                                 📝 A
(Both current sequence and decoded text shown)

5. Multiple Characters

✓ 5  ✗ 2  📊 71.4%  [Reset]     ⚡ ...
                                 📝 ANT
(Building "S", already have "ANT")

6. After Check Answer

✓ 6  ✗ 2  📊 75.0%  [Reset]
(Cleared after checking, ready for next item)

Visual Indicators

Icons and Colors

  • ⚡ Lightning: Active input (you're currently typing)

    • Color: Yellow/Orange (attention-grabbing)
    • Meaning: "This is being built right now"
  • 📝 Memo: Completed text (finished characters)

    • Color: Green (success/completion)
    • Meaning: "These are done and decoded"

Font Choice

  • Monospace: Ensures consistent character width
  • 16pt: Large enough to read easily but not dominating
  • Bold: Not used - keeps it subtle and non-intrusive

Integration

Works With

  • ✅ Listening Practice mode
  • ✅ All session selections (1-10)
  • ✅ All practice types
  • ✅ Timeout features
  • ✅ Answer checking
  • ✅ Statistics tracking

Doesn't Interfere With

  • Statistics display (shares space cleanly)
  • Result display (appears above)
  • Correct answer display (appears above)
  • Control buttons (below)

Usability Improvements

For Beginners

  • Visual confirmation builds confidence
  • Helps learn Morse patterns faster
  • Reduces frustration from "mystery errors"
  • Makes training less stressful

For Intermediate

  • Quick error spotting
  • Pattern reinforcement
  • Speed verification
  • Timing feedback

For Advanced

  • Fine-tuning paddle technique
  • Catching subtle timing issues
  • Maintaining consistency
  • Quality control

Examples in Practice

Example 1: Learning "SOS"

Play: ••• --- •••

User sends:
⚡ ...           (building S)
📝 S            (S decoded!)
⚡ ---           (building O)
📝 SO           (O decoded!)
⚡ ...           (building S)
📝 SOS          (Complete!)

Check Answer: ✓ RIGHT!

Example 2: Making a Mistake

Play: CAT

User sends:
⚡ -.-.          (building C)
📝 C            (C decoded!)
⚡ ..-           (oops! sent U instead of A)
📝 CU           (U decoded - visible mistake!)

User realizes: "I see CU but it should be CA"

Example 3: Speed Practice

Play: 5NN

User sends:
⚡ .....         (building 5)
📝 5            
⚡ -.            (building N)
📝 5N           
⚡ -.            (building N)
📝 5NN          

Real-time feedback on each character!

Summary

Feature: Real-time Morse input display Location: Training window, listening practice mode, right of statistics Shows: Current sequence (⚡) + decoded text (📝) Purpose: Visual feedback of paddle input Benefits: Faster learning, error detection, confidence building

The display provides crucial visual feedback during training, helping users learn Morse code more effectively by seeing exactly what they're sending in real-time!