Last active
January 1, 2022 13:43
-
-
Save LevitatingBusinessMan/689e840b8c23d7426b591035e5f8cb5f to your computer and use it in GitHub Desktop.
Eren - phonetic alphabet typer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"A": "Alpha", | |
"B": "Bravo", | |
"C": "Charlie", | |
"D": "Delta", | |
"E": "Echo", | |
"F": "Foxtrot", | |
"G": "Golf", | |
"H": "Hotel", | |
"I": "India", | |
"J": "Juliett", | |
"K": "Kilo", | |
"L": "Lima", | |
"M": "Mike", | |
"N": "November", | |
"O": "Oscar", | |
"P": "Papa", | |
"Q": "Quebec", | |
"R": "Romeo", | |
"S": "Sierra", | |
"T": "Tango", | |
"U": "Uniform", | |
"V": "Victor", | |
"W": "Whiskey", | |
"X": "X-ray", | |
"Y": "Yankee", | |
"Z": "Zulu" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import keyboard | |
import json | |
on = False | |
with open('alphabet.json') as json_file: | |
on = False | |
alphabet = json.load(json_file) | |
def toggle(): | |
global on | |
on = not on | |
keyboard.add_hotkey("ctrl+shift+p", toggle) | |
def write(v): | |
if (on): | |
keyboard.write(v) | |
for key, value in alphabet.items(): | |
keyboard.add_hotkey(key, write, args=[value[1:] + " "]) #lowercase | |
keyboard.add_hotkey("shift+"+key, write, args=[value[1:] + " "]) #uppercase | |
keyboard.wait() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment