thaikeyfix nitichote@dev
winget install --id=nitichote@dev.thaikeyfix -e thaikeyfix - Thai <-> English keyboard layout fixer
winget install --id=nitichote@dev.thaikeyfix -e thaikeyfix - Thai <-> English keyboard layout fixer
ภาษาไทย: คู่มือภาษาไทยอยู่ด้านล่าง ⬇ · ฉบับ PDF สำหรับพิมพ์/ส่งต่อ: คู่มือ-thaikeyfix.pdf
A tiny background Windows program that fixes text typed with the wrong keyboard layout. Highlight the mistyped text in any application, press Ctrl+` (the key just above Tab), and it swaps the characters between the Thai (Kedmanee) and US English layouts in place.
It does not translate meaning. It remaps each character by its physical key
position — the same trick as classic layout-fixer tools. Example: trying to type
สวัสดี with the US layout still active gives l;ylfu; select it, press Ctrl+, and you get สวัสดี` back. It works both directions and auto-detects which.
> Why not Alt+Q? Alt+Q is a built-in Microsoft Word shortcut (it opens the > "Tell Me / Search" box), and Alt drives the Word ribbon, so it stole the > keystroke and pasting misbehaved. Ctrl+` avoids all of that and is unused in > Word.
Both auto-detect direction (Thai↔English) and can be used in any app that supports normal keyboard selection and copy/paste.
Whenever you switch the keyboard language — with the ` (grave) key, Alt+Shift or Win+Space — the tool plays a short beep pitched by the language you just switched to:
The tray icon doubles as a big language indicator: it shows a blue ท while the window you're in uses the Thai layout and a green E while it uses English — updating as you switch languages or move between windows, so a glance at the tray always tells you what you're about to type.
The beep is stricter than the icon. A beep requires both: a switch key was pressed (, Alt+Shift, Ctrl+Shift or Win+Space) within the last second, **and** the language of the window you're in really changed. That means clicking between windows or taskbar icons never beeps (no key was pressed — Windows' focus-time language sync can't trigger it), and typing a literal `` `` character or using
Ctrl+Shift app shortcuts stays silent too (no language change follows).
Switching via the taskbar language menu with the mouse alone is the one path
that stays silent by design. Toggle the feature via
Language sound: On/Off in the tray menu; Pause also silences it. To
change the pitch or length, edit BEEP_EN_HZ / BEEP_TH_HZ / BEEP_MS in
src/main.rs.
Right-click the empty background of any folder in Explorer and pick
Save clipboard image to PNG: whatever image is on the clipboard (a PrtScn
screenshot, a picture copied from a browser or document) is saved into that
folder as clip_YYYYMMDD_HHMMSS.png (with _2, _3, ... if you save twice
in the same second). A soft chirp confirms the save; if the clipboard has no
image you get a small explanatory popup instead. Note that copying an image
file in Explorer copies the file, not the image — open the image and copy it
for this to work.
The menu registers itself automatically every time thaikeyfix starts, under
HKCU\Software\Classes\Directory\Background\shell (per-user; no admin
prompt), pointing at the running exe — so if you move the exe, the menu
follows on the next start. Turn it off (and remove the registry entry) via
Folder menu (save clipboard PNG): On/Off in the tray menu; the choice is
remembered across restarts.
RegisterHotKey), so they fire no
matter which app is focused.There is no universal Windows API to read text around the cursor from an arbitrary app, so the copy-convert-paste (and simulated-selection) approach is how every tool of this kind works.
No installation needed — it's a single portable exe.
Download: grab thaikeyfix-vX.Y.Z-x64.exe from the
Releases page,
put it anywhere, and run it.
winget (once the package is approved):
winget install Nitichote.Thaikeyfix
Or build it yourself:
You need the Rust toolchain (https://rustup.rs) on Windows.
cargo build --release
The binary lands at target\release\thaikeyfix.exe. Release builds use
windows_subsystem = "windows", so there is no console window — it runs in
the background and shows only a system-tray icon (a small blue/green square
next to the clock).
Double-click thaikeyfix.exe (or run it from a terminal). Then in any program:
either select mistyped text → Ctrl+`, or just leave the cursor after the
mistyped word → Ctrl+1.
You'll see the language icon appear in the system tray (bottom-right, near the
clock — you may need to click the ^ to expand hidden icons): blue ท =
Thai layout active, green E = English. Right-click it for:
The compiled .exe also carries the author and description under right-click →
Properties → Details (embedded via build.rs).
Run a debug build (cargo run) if you want a console with log messages while
testing.
Put a shortcut to the exe in your Startup folder. Press Win+R, enter
shell:startup, and drop a shortcut to thaikeyfix.exe in there.
The layout table has unit tests (no Windows APIs needed for these):
cargo test
MOD_CONTROL / VK_OEM_3 in src/main.rs. The
modifier flags are MOD_CONTROL = 0x0002, MOD_ALT = 0x0001,
MOD_SHIFT = 0x0004; OR them together. The second value is the virtual-key
code (e.g. 0x51 = Q, 0xC0 = `). For example Ctrl+Shift+Q is
MOD_CONTROL | MOD_SHIFT with 0x51.PAIRS table in src/layout.rs. Each entry
is (english_char, thai_char) for one key. The table is verified against
Microsoft's official KBDTH0 layout and is a clean bijection.Duration::from_millis(...) values in src/main.rs._ / - % + " , . ( ) ?) produce ASCII on the Thai
side. In an all-ASCII selection the direction detector can't tell those apart
from English, so isolated punctuation may convert unexpectedly. Real mistyped
words (which contain Thai letters) are unaffected.PAIRS table.Cargo.toml dependencies (arboard, enigo, winapi, png, winreg)
src/main.rs hotkey registration, message loop, copy/convert/paste,
language-switch sound + tray language icon, CLI mode
src/layout.rs the Kedmanee<->QWERTY table + convert() + tests
src/clipsave.rs clipboard-image -> PNG + Explorer context-menu registry
assets/ embedded tray icons (ท = Thai, E = English)
โปรแกรมเล็ก ๆ ทำงานเบื้องหลังบน Windows มีความสามารถ 3 อย่าง: แก้ข้อความที่พิมพ์ผิดภาษา (ลืมสลับแป้น), มีเสียงและไอคอนบอกภาษาที่กำลังใช้, และเซฟรูปจากคลิปบอร์ดเป็นไฟล์ PNG ด้วยเมนูคลิกขวา — ฉบับเต็มพร้อมภาพขั้นตอนอยู่ที่ คู่มือ-thaikeyfix.pdf
ดาวน์โหลด thaikeyfix-vX.Y.Z-x64.exe จากหน้า
Releases
วางไว้ในโฟลเดอร์ถาวร (เช่น C:\Tools\thaikeyfix) แล้วดับเบิลคลิกเปิดได้เลย
ไม่ต้องติดตั้งอะไรเพิ่ม — ครั้งแรกถ้า Windows ขึ้นจอฟ้า SmartScreen
ให้กด More info → Run anyway เปิดแล้วจะเห็นไอคอนภาษาที่ tray มุมขวาล่าง
อยากให้เปิดเองตอนเข้า Windows: กด Win+R พิมพ์ shell:startup
แล้ววาง shortcut ของ exe ลงไป
| ปุ่มลัด | การใช้ |
|---|---|
Ctrl + ` | ไฮไลต์ข้อความที่พิมพ์ผิดก่อน แล้วกด — สลับไทย⇄อังกฤษให้ทันที |
Ctrl + 1 | ไม่ต้องไฮไลต์ วางเคอร์เซอร์ท้ายคำที่ผิดแล้วกด แปลงคำล่าสุดให้เอง |
เช่น l;ylfu → สวัสดี, mflv[ → ทดสอบ — โปรแกรมเลือกทิศทางเองอัตโนมัติ
กดปุ่มสลับภาษา (`, Alt+Shift, Ctrl+Shift, Win+Space) แล้วจะมีเสียงสั้น ๆ
บอกภาษาใหม่ทันที: อังกฤษ = เสียงสูง, ไทย = เสียงต่ำ และไอคอน tray
เปลี่ยนตามภาษาปัจจุบันตลอดเวลา: ท พื้นน้ำเงิน = ไทย / E พื้นเขียว = อังกฤษ
คลิกสลับหน้าต่างเฉย ๆ จะไม่มีเสียงรบกวน ปิด/เปิดเสียงได้ที่เมนู tray
จับหน้าจอ (PrtScn หรือ Win+Shift+S) หรือ copy รูปจากที่ไหนก็ได้
แล้วคลิกขวาบนพื้นที่ว่างในโฟลเดอร์ → Save clipboard image to PNG
ได้ไฟล์ clip_วันที่_เวลา.png ทันที (Windows 11 อาจต้องกด "Show more options"
ก่อน) เมนูนี้ลงทะเบียนให้เองตอนเปิดโปรแกรม ถอนออกได้จากเมนู tray
Pause/Resume พักการทำงานชั่วคราว · Language sound: On/Off เปิด/ปิดเสียง · Folder menu: On/Off เพิ่ม/ถอนเมนูคลิกขวาในโฟลเดอร์ · About... ข้อมูลโปรแกรม · Quit ปิดโปรแกรม
ตั้ง Folder menu เป็น Off ก่อน (ถอนเมนูคลิกขวาออกจาก Windows) → Quit → ลบไฟล์ exe และ shortcut ใน Startup — ไม่มีไฟล์ตกค้าง โปรแกรมทำงานในเครื่องทั้งหมด ไม่ส่งข้อมูลออกอินเทอร์เน็ต