By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
World of SoftwareWorld of SoftwareWorld of Software
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Search
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
Reading: Tap to Morse Key, an App that Makes It Easier for People With Disabilities to Communicate | HackerNoon
Share
Sign In
Notification Show More
Font ResizerAa
World of SoftwareWorld of Software
Font ResizerAa
  • Software
  • Mobile
  • Computing
  • Gadget
  • Gaming
  • Videos
Search
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Have an existing account? Sign In
Follow US
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
World of Software > Computing > Tap to Morse Key, an App that Makes It Easier for People With Disabilities to Communicate | HackerNoon
Computing

Tap to Morse Key, an App that Makes It Easier for People With Disabilities to Communicate | HackerNoon

News Room
Last updated: 2025/08/08 at 10:26 AM
News Room Published 8 August 2025
Share
SHARE

Communication is fundamental to human connection, but for many people, speaking or typing isn’t even possible. I wanted to create a simple tool that could help those who cannot communicate by allowing them to speak using only one finger and some simple keyboard inputs.

My goal was not to build a commercial product but to demonstrate that anyone, even without extensive programming experience, can create helpful tools with the support of AI and accessible coding libraries.

This project shows how a clear problem, combined with basic programming and AI guidance, can lead to a functional communication tool for people who might otherwise struggle to express themselves.

How I Built Tap-to-Morse Keys Using Python and AI

This program lets users communicate by tapping arrow keys:

Left for dot (.)

Right for dash (-)

Up once to end a letter

Up twice quickly to end a word

Down to read the phrase aloud

Space to delete the last dot/dash

It uses Morse code to translate these taps into letters, words, and phrases, then speaks them out loud. Here’s the code with detailed explanations.

1. Imports and Setup

import pyttsx3

import keyboard

import time

pyttsx3: Text-to-speech engine to vocalize the decoded phrase.

keyboard: To detect arrow key presses in real-time.

time: To measure intervals between key presses, especially for double-tap detection.

2. Morse Code Dictionary

morse_dict = {

'.-': 'A', '-...': 'B', '-.-.': 'C', '-..': 'D', '.': 'E',

'..-.': 'F', '--.': 'G', '....': 'H', '..': 'I', '.---': 'J',

'-.-': 'K', '.-..': 'L', '--': 'M', '-.': 'N', '---': 'O',

'.--.': 'P', '--.-': 'Q', '.-.': 'R', '...': 'S', '-': 'T',

'..-': 'U', '...-': 'V', '.--': 'W', '-..-': 'X', '-.--': 'Y',

'--..': 'Z', '-----': '0', '.----': '1', '..---': '2',

'...--': '3', '....-': '4', '.....': '5', '-....': '6',

'--...': '7', '---..': '8', '----.': '9'

}

Maps dots and dashes to letters and numbers for translation.

The program looks up user input sequences here to find the matching character.

3. Initialize Text-to-Speech and Variables

engine = pyttsx3.init()

engine.setProperty('rate', 150)

current_morse = ''

current_word = ''

phrase = ''

previous_key = ''

last_up_time = 0

Initializes the speech engine and sets a comfortable speaking rate.

Variables track input:

current_morse: holds the dot/dash sequence of the current letter.

current_word: the letters collected to form a word.

phrase: the complete phrase built from multiple words.

previous_key prevents repeated inputs from a held key.

last_up_time helps detect if the up arrow is pressed once or twice quickly.

4. Display Controls to the User

print("Controls:")

print("← = Dot | → = Dash | ↑ (once) = End Letter | ↑ (twice) = End Word")

print("↓ = Read Phrase | Space = Delete Last Dot/Dash")

print("-" * 50)

Simple instructions to guide how to use the program.

Shows which arrow corresponds to each Morse code input or control command.

5. Listening for Dot Input (Left Arrow)

while True:

if keyboard.is_pressed('left'):

if previous_key != 'left':

current_morse += '.'

print(f"Dot (.) | Morse: {current_morse}")

previous_key = 'left'

time.sleep(0.2)

Detects Left arrow press adds a dot (.) to the current letter’s Morse code.

Prints the current Morse code for feedback.

Sleeps briefly to avoid multiple counts from a single key hold.

6. Listening for Dash Input (Right Arrow)

elif keyboard.is_pressed('right'):

if previous_key != 'right':

current_morse += '-'

print(f"Dash (-) | Morse: {current_morse}")

previous_key = 'right'

time.sleep(0.2)

Detects Right arrow, adds a dash (-).

Provides feedback similarly to dot input.

7. Deleting Last Dot/Dash (Space Bar)

elif keyboard.is_pressed('space'):

if previous_key != 'space':

if current_morse:

print(f"Deleted: {current_morse[-1]}")

current_morse = current_morse[:-1]

print(f"Current Morse: {current_morse}")

else:

print("Nothing to delete.")

previous_key = 'space'

time.sleep(0.2)

Deletes the last input symbol (dot or dash) in the current Morse letter.

Helpful for correcting mistakes before ending a letter.

8. Ending Letters and Words (Up Arrow)

elif keyboard.is_pressed('up'):

if previous_key != 'up':

current_time = time.time()

if current_time - last_up_time < 1.0:

# Second up press within 1 second = end word

if current_morse:

letter = morse_dict.get(current_morse, '?')

current_word += letter

current_morse = ''

phrase += current_word + ' '

print(f"Word: {current_word}")

current_word = ''

else:

# First up press = end letter

if current_morse:

letter = morse_dict.get(current_morse, '?')

current_word += letter

print(f"Letter: {letter} | Word: {current_word}")

current_morse = ''

last_up_time = current_time

previous_key = 'up'

time.sleep(0.2)

First up press: finishes current letter, converts Morse to letter, and adds to current word.

Second up press (within 1 second): finishes current word, adds it plus a space to the phrase, then clears the current word buffer.

Prints feedback about letters and words to keep the user informed.

9. Reading Phrase Aloud (Down Arrow)

elif keyboard.is_pressed('down'):

if previous_key != 'down':

if current_morse:

letter = morse_dict.get(current_morse, '?')

current_word += letter

current_morse = ''

if current_word:

phrase += current_word

current_word = ''

if phrase.strip():

print(f"Phrase: {phrase.strip()}")

engine.say(phrase.strip())

engine.runAndWait()

phrase = ''

previous_key = 'down'

time.sleep(0.5)

Finalizes any unfinished letter or word.

Uses pyttsx3 to read the entire phrase aloud.

Resets the phrase to start fresh.

10. Resetting Key Detection

else:

previous_key = '' # Reset when no key pressed

Allows the program to detect new key presses after keys are released.

Final Thoughts

With just a few libraries and lines of code, I created a one-finger communication tool using AI-assisted coding. This project shows how anyone with curiosity and some help from AI can build tools that empower people with communication challenges.

If you want to help others or experiment with accessible tech, start small, use AI to guide you, and keep building. Tools like this can make a real difference.

The codes and .exe file. If you like to test or see the app yourself.

Sign Up For Daily Newsletter

Be keep up! Get the latest breaking news delivered straight to your inbox.
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Share This Article
Facebook Twitter Email Print
Share
What do you think?
Love0
Sad0
Happy0
Sleepy0
Angry0
Dead0
Wink0
Previous Article Ninja Luxe Cafe Pro Series ES701UK Review: Any type of coffee
Next Article Sat, 08/09/2025 – 19:00 – Editors Summary
Leave a comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

248.1k Like
69.1k Follow
134k Pin
54.3k Follow

Latest News

The UK government’s AI Growth Zones strategy: Everything you need to know | Computer Weekly
News
The Last Cloud Storage Plan You’ll Ever Need Is on Sale
News
27 Powerful Prompts for Game Development [UPDATED]
Computing
Hackers Went Looking for a Backdoor in High-Security Safes—and Now Can Open Them in Seconds
Gadget

You Might also Like

Computing

27 Powerful Prompts for Game Development [UPDATED]

15 Min Read
Computing

How to Choose HR Software That Fits Your Team’s Needs

27 Min Read
Computing

Beyond ChatGPT: How One Founder Combined 100+ AI Models Into a Single Platform | HackerNoon

6 Min Read
Computing

Bcachefs Maintainer Comments On The LKML While Waiting To See What Happens

3 Min Read
//

World of Software is your one-stop website for the latest tech news and updates, follow us now to get the news that matters to you.

Quick Link

  • Privacy Policy
  • Terms of use
  • Advertise
  • Contact

Topics

  • Computing
  • Software
  • Press Release
  • Trending

Sign Up for Our Newsletter

Subscribe to our newsletter to get our newest articles instantly!

World of SoftwareWorld of Software
Follow US
Copyright © All Rights Reserved. World of Software.
Welcome Back!

Sign in to your account

Lost your password?