Skip to content
DarkLianPublic

About

Windows tray tool: convert Traditional ⇄ Simplified Chinese in any app with a hotkey.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

ToSimp

A tiny Windows tray tool that converts Chinese text between Traditional and Simplified with one hotkey, in any app. Select text (or let it select everything), press a key, and the text is replaced in place.

Hotkeys

Key Action
F8 Selected text → Simplified
F9 All text in the focused field → Simplified
Ctrl+F8 Selected text → Traditional
Ctrl+F9 All text in the focused field → Traditional
Ctrl+Alt+T Turn the tool on or off

The tray icon turns grey when disabled. The tray menu also has Start with Windows and a Help list.

How it works

On a hotkey, ToSimp sends Ctrl+C (after Ctrl+A for F9), converts the clipboard text with OpenCC, pastes it back with Ctrl+V, then restores your previous clipboard text.

  • Traditional → Simplified uses OpenCC tw2sp (Taiwan Traditional, with common word substitutions).
  • Simplified → Traditional uses OpenCC s2t (character conversion only).

Install

Requires Windows and Python 3.9+.

git clone https://github.com/DarkLian/ToSimp.git
cd ToSimp
pip install -r requirements.txt

Run it by double-clicking tosimp.pyw, or:

pythonw tosimp.pyw

Windows will show a UAC prompt: the script relaunches itself as administrator so the hotkeys also work inside elevated apps. Choose Start with Windows in the tray menu to register a scheduled task that starts it at logon.

Settings

Edit the constants at the top of tosimp.pyw:

  • ALLOWED_APPS: leave empty to work everywhere, or list executables, e.g. {"chrome.exe", "notepad.exe"}.
  • BLOCKED_APPS: executables where the hotkeys never fire, e.g. games that use F8/F9. Empty by default.

Errors are written to tosimp.log next to the script.

Compatibility

Developed and used on Windows 11. Not tested on other systems.

  • Other Windows versions: it only uses standard Win32 calls, Task Scheduler and PowerShell, so Windows 10 should work, but this is untested.
  • Linux / macOS: not supported. The script uses ctypes.windll, schtasks and PowerShell, which exist only on Windows. Porting would need a different elevation, autostart and foreground-app approach.

Notes

  • Security: the tool runs with administrator rights, installs a global keyboard hook and briefly reads and overwrites your clipboard. It never sends data anywhere; the code is a single readable file. The optional startup task is registered with the highest run level; remove it by unticking Start with Windows.

  • Hotkeys are global, and F8/F9 are intercepted while the tool is enabled; pause it (Ctrl+Alt+T) in programs that need those keys.

  • Only text is handled. Rich clipboard content (images, formatting) is replaced during the operation.

  • The tray icon glyph uses the Microsoft YaHei font (msyh.ttc) when available.

License

MIT

About

Windows tray tool: convert Traditional ⇄ Simplified Chinese in any app with a hotkey.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages