A small set of background daemons for Windows and Linux that fix the two most annoying things that happen when you type in a mix of Hebrew and English:
- Wrong keyboard layout. You wanted
how are thingsbut typedctv,ukh,n,fbho(or the opposite direction). Press a hotkey and it is instantly converted by physical key position, using the standard Israeli SI-1452 layout. - Spelling and grammar mistakes — in both Hebrew and English. Press a hotkey and the last sentence is fixed in place, in its original language.
The rest (rewrite / summarize / expand into a prompt / optimize prompt) is English-only AI sugar on top. Hebrew input is intentionally skipped for those tools so you never end up with a surprise English translation of your Hebrew text.
git clone https://github.com/silver3667/TypeFlip.git
cd TypeFlip/typing-assistant
pip install -r requirements.txtOpen a terminal as administrator and run:
setx OPENAI_API_KEY "your_key_here"This sets it permanently. Restart your terminal for it to take effect.
Right-click typing-assistant\run_daemon.bat → Run as administrator.
Why admin? The
keyboardlibrary needs admin privileges on Windows to capture global hotkeys. Without it, hotkeys won't work.
- Type or select some text in any app
- Select the text (
Ctrl+Aor drag to highlight) - Press the hotkey (see table below)
- The text is replaced in place
- Press
Win+R, typeshell:startup, press Enter. - Right-click inside that folder → New → Shortcut.
- Point the shortcut at
typing-assistant\run_daemon.bat. - Right-click the new shortcut → Properties → Advanced → check Run as administrator → OK.
- Done. It will start silently (with an admin prompt) every time you log in.
Select text first, then press:
| Shortcut | Action |
|---|---|
Shift+F1 |
Fix keyboard layout (Hebrew ↔ English) |
Shift+F2 |
Fix spelling / grammar (Hebrew and English) |
Shift+F3 |
Rewrite text more professionally (EN only) |
Shift+F4 |
Summarize text (EN only) |
Shift+F5 |
Optimize text as an AI prompt (EN only) |
Shift+F6 |
Expand idea into a full AI prompt (EN only) |
Shift+F7 |
Humanize AI-sounding text (EN only) |
(EN only) = English only. If you trigger these on Hebrew text, the daemon skips it and leaves your text alone.
There are three independent daemons. Pick whichever fits your workflow — they don't need to run together.
| Folder | Uses clipboard | AI | Best for |
|---|---|---|---|
layout_fix/ (root) |
Yes (Select All → Copy → Paste) | No | Fixing a whole field at once |
layout-fix-daemon/ |
No (rolling keystroke buffer) | No | Fixing just what you typed |
typing-assistant/ |
Yes (select → hotkey → replaced) | Yes (OpenAI) | Full experience: layout + spelling + AI tools |
typing-assistant/ is the main one. The other two are simpler, dependency-light
alternatives if you just want layout conversion and nothing else.
The typo corrector looks at the text first. If it's mostly Hebrew letters it
uses a Hebrew prompt that explicitly says do not translate, return Hebrew.
If it's mostly English it uses the English prompt. So שלןם עולם becomes
שלום עולם, and helo wrld becomes hello world.
Conversion is done by physical key position, not by transliteration. Example:
- Hebrew
ים'(keys at positions h, o, w) →how - English
how→ים' - Hebrew
ctv ukh n,fbho→how are things
- Python 3.11+
- Windows 10/11 or Linux (graphical session, not SSH)
- Administrator privileges (required for global hotkey capture)
- Dependencies:
keyboard,pynput,pyperclip,openai OPENAI_API_KEYenvironment variable — only needed for the AI-powered tools (spelling fix, rewrite, summarize, expand, optimize, humanize)
# layout conversion tests (root)
pytest tests/ -v
# buffer-based daemon tests
pytest layout-fix-daemon/tests/ -v
# typing-assistant processor tests (needs OPENAI_API_KEY)
pytest typing-assistant/tests/ -v- The daemons only send local keystrokes (backspace, typing, clipboard) to whichever window has focus. They don't capture, log, or upload your keystrokes anywhere.
- The typing-assistant buffer keeps the last 200 characters in memory only, and is wiped when the daemon exits. It is never written to disk.
- The AI features only run when you press the matching hotkey, and they only send the selected text to OpenAI.
- The daemon does not modify any system settings, registry entries, startup entries, or permissions. Autostart is opt-in via a shortcut you place yourself.
This is expected. The daemon grabs your selection by sending Ctrl+C, but
in a terminal Ctrl+C means "cancel the running command" (SIGINT), not
"copy". So Shift+F1/F2/etc. fired inside a terminal will either interrupt
whatever's running, copy nothing, or copy a stale clipboard value — none of
which is what you want.
The daemon is built for editable text in real apps: Notepad, Word, browsers, Slack, Discord, VS Code's editor pane, Outlook, anywhere with a real text field. If you need to fix something you typed in a terminal, paste it into Notepad first, run the hotkey there, then copy the result back.
PRs welcome: a clean fix would be to detect a terminal/console window via
GetClassNameW on the foreground window and either fall back to
Ctrl+Shift+C or refuse the hotkey with a clear log message instead of
silently misbehaving.
This almost always means two daemons are running — both register the same
hotkey, both respond, both paste. The daemon will refuse to start a second
instance and print ANOTHER DAEMON IS ALREADY RUNNING, but a leftover
pythonw.exe from a previous logon session can slip past that check when the
new daemon is started without administrator privileges.
Find the running daemons:
Get-CimInstance Win32_Process -Filter "Name='python.exe' OR Name='pythonw.exe'" |
Select-Object ProcessId, Name, CommandLine, CreationDateKill the old one (replace <PID> with the older pythonw.exe):
taskkill /PID <PID> /FThen start the daemon as administrator (right-click run_daemon.bat → Run
as administrator) so the singleton lock is machine-wide and zombies can't
hide from it.
The daemon also writes a log to ~/.typing-assistant/daemon.log — open it to
see whether the duplicate paste came from one daemon firing twice (look at
call IDs) or from two daemons each handling the same press.
This means the Shift key is being captured globally. It was caused by an old
bug where hotkeys were registered with suppress=True. This was fixed in
commit 00ff08f.
If it happens to you:
- Open Task Manager and kill all
pythonw.exe/python.exeprocesses running the daemon. - Make sure you have the latest code (
git pull). - Restart the daemon: double-click
typing-assistant\run_daemon.bat.
For developers: never set suppress=True on keyboard.add_hotkey() for
hotkeys that use a modifier key (Shift, Ctrl, Alt). The keyboard library
will swallow that modifier globally, breaking normal typing.
MIT. See LICENSE.