Skip to content

zuaq/zwitchType

Repository files navigation

zwitchType — แอปสลับภาษาอัตโนมัติสำหรับ Mac

แอปสลับภาษาคีย์บอร์ดอัตโนมัติ ไทย ↔ อังกฤษ พร้อมแก้ไขคำสะกด — สำหรับ macOS เท่านั้น

🖥️ Mac Only — แอป macOS ดั้งเดิม สร้างด้วย SwiftUI ไม่รองรับ Windows, Linux, iOS หรือ iPad

🇹🇭🇬🇧 รองรับเฉพาะภาษาไทยและอังกฤษเท่านั้น — ไม่รองรับภาษาอื่น

macOS macOS 26 Swift License Buy Me a Coffee

🇬🇧 Read in English


ปัญหาที่แอปนี้แก้ได้

พิมพ์ไปแล้วพบว่าลืมสลับภาษา — เช่น พิมพ์ "สวัสดี" แต่ได้ l;ylfu หรือจะพิมพ์ "hello" แต่ได้ ้ำสสน 1774177712730 zwitchType ตรวจจับอัตโนมัติเมื่อพิมพ์ผิดภาษา ลบข้อความที่ผิด แล้วพิมพ์ใหม่ให้ถูกต้อง พร้อมสลับภาษาคีย์บอร์ดให้


คุณสมบัติหลัก

  • ตรวจจับและแก้ไขภายใน <1ms
  • ประมวลผลบนเครื่องทั้งหมด ไม่ส่งข้อมูลออกภายนอก ไม่เก็บประวัติการพิมพ์
  • ใช้ทรัพยากรน้อย ไม่กระทบแบตเตอรี่
  • รองรับทั้ง Kedmanee และ Pattachote ตรวจจับ layout อัตโนมัติ
  • แก้ไขคำสะกดด้วยพจนานุกรม (Beta)
  • รองรับ Liquid Glass บน macOS 26
  • UI ภาษาไทยและอังกฤษ เปลี่ยนได้ทันที
  • รองรับเฉพาะภาษาไทยและอังกฤษ

วิธีใช้งาน

  1. ติดตั้งแอป — ลาก zwitchType.app ไปที่ /Applications
  2. ให้สิทธิ์ — เปิดแอป → ทำตาม Welcome Screen → ให้สิทธิ์ Accessibility
  3. พิมพ์ตามปกติ — แอปทำงานอัตโนมัติที่ menu bar ไม่ต้องตั้งค่าอะไรเพิ่ม
  4. สลับภาษาผิด? — แอปจะตรวจจับ ลบ และพิมพ์ใหม่ให้อัตโนมัติ
  5. แปลงเอง — เลือกข้อความ + กด hotkey เพื่อแปลงภาษาด้วยตัวเอง (ชื่อเฉพาะ, แบรนด์ ฯลฯ)

ฟีเจอร์ทั้งหมด

ฟีเจอร์ รายละเอียด
สลับภาษาอัตโนมัติ ตรวจจับเมื่อพิมพ์ผิดภาษา แก้ไขทันที
Manual Convert (แปลงเอง) เลือกข้อความ + กด hotkey เพื่อแปลงภาษา ใช้ได้กับทุกคำ
ตรวจจับชื่อเฉพาะ Shift+ตัวอักษร = ชื่อคน/แบรนด์ แปลงได้แม้ไม่อยู่ใน dictionary
แก้ไขคำสะกด 2 โหมด: ปิด (ค่าเริ่มต้น) / พจนานุกรม (Beta)
พจนานุกรมส่วนตัว เพิ่ม/ลบคำเฉพาะของคุณ ทั้งไทยและอังกฤษ
แอปที่ยกเว้น เลือกแอปที่ไม่ต้องการสลับภาษาอัตโนมัติ (เช่น Terminal, VS Code)
Clipboard Mode สำหรับแอปที่ keystroke simulation ไม่ทำงาน
Undo (Cmd+Z) กลับข้อความเดิมได้ทันทีภายใน 5 วินาที
เปิดเมื่อเข้าสู่ระบบ เปิดอัตโนมัติทุกครั้งที่ login
Secure Input หยุดทำงานอัตโนมัติในช่อง password
Event Tap Health ตรวจสอบและกู้คืนอัตโนมัติเมื่อ monitor หยุดทำงาน

โหมดแก้ไขคำสะกด

โหมด ความเร็ว ความแม่นยำ ความต้องการ
ปิด (ค่าเริ่มต้น)
พจนานุกรม (Beta) <1ms ~95% ทุกเครื่อง

⚠️ ข้อจำกัดที่ควรทราบ

การแก้ไขคำสะกดเป็น Beta — ทำงานได้ดีในหลายกรณี แต่มีข้อจำกัด:

  • คำที่ต้องแก้ไขมากกว่า 1 ตัวอักษร อาจแก้ไม่ได้ เช่น "ตังแต" → "ตั้งแต่" (ต้องเพิ่มทั้ง ้ และ ่)
  • คำที่ตัดแล้วเป็นคำถูกทั้งคู่ จะไม่ถูกแก้ เช่น "กระเพรา" ถูกตัดเป็น "กระ"+"เพรา" ซึ่งเป็นคำจริงทั้งคู่ แม้คำที่ถูกต้องคือ "กะเพรา"
  • คำสั้น 1-2 ตัวอักษร บางคำอาจตรวจจับผิดพลาดได้
  • แนะนำ: ตรวจสอบข้อความที่แก้ไขก่อนใช้งานเสมอ ใช้ Cmd+Z เพื่อ undo ได้ภายใน 5 วินาที

หากพบคำที่แก้ไขผิดซ้ำ → เพิ่มคำนั้นใน พจนานุกรมส่วนตัว เพื่อป้องกัน


พจนานุกรมส่วนตัว (Custom Dictionary)

เพิ่มคำที่ต้องการให้แอปรู้จัก — คำที่เพิ่มจะ ไม่ถูกแก้ไขอัตโนมัติ และจะถูกใช้ในการ ตรวจจับภาษา ด้วย

เพิ่มคำแบบไหนได้:

  • ชื่อคน ชื่อแบรนด์ ชื่อบริษัท (เช่น "zuaq", "เบนซ์")
  • คำศัพท์เฉพาะทาง คำวิชาชีพ (เช่น "kubernetes", "กะเพรา")
  • คำที่แอปแก้ไขผิดซ้ำ — เพิ่มเพื่อป้องกัน
  • คำสแลง คำย่อที่ใช้บ่อย

ตั้งค่าที่: Settings → แท็บ "พจนานุกรม" → เลือกภาษา (ไทย/อังกฤษ) → พิมพ์คำ → กดเพิ่ม


ความต้องการของระบบ

ขั้นต่ำ แนะนำ
macOS macOS 15+ macOS 26 (Tahoe)
ชิป Intel หรือ Apple Silicon Apple Silicon (M1+)
สิทธิ์ Accessibility Accessibility
ภาษา ไทย + อังกฤษ ไทย + อังกฤษ
UI Standard Liquid Glass (macOS 26)

ติดตั้ง

ดาวน์โหลด

ดาวน์โหลดเวอร์ชันล่าสุดที่ Releases

⚠️ เปิดแอปครั้งแรก

แอปนี้ไม่ได้ลงทะเบียนกับ Apple Developer Program ดังนั้น macOS จะแสดงคำเตือน "ไม่สามารถเปิดได้" ในครั้งแรก

วิธีเปิด:

  1. เปิดแอป → macOS จะแจ้งว่า "ไม่สามารถเปิดได้" → กด Done
  2. เปิด System Settings → Privacy & Security
  3. เลื่อนลงหา Security → กดปุ่ม Open Anyway
  4. กด Open อีกครั้ง → แอปจะเปิดได้

ทางเลือก (Terminal): xattr -cr /Applications/zwitchType.app

ทำครั้งเดียว macOS จะจำไว้ ไม่ต้องทำซ้ำอีก

Build จาก Source Code

git clone https://github.com/zuaq/zwitchType.git
cd zwitchType
open zwitchType.xcodeproj
# Build ด้วย Xcode (Cmd+B)

ต้องใช้ Xcode 16+ (Xcode 26 สำหรับ Liquid Glass)


สนับสนุน

Buy Me a Coffee


ผลทดสอบ / Test Results

ทดสอบ 410 เคส (100+ ต่อหมวด) — ดูผลเต็มที่ TEST_RESULTS.md

หมวด ผล จำนวน
อังกฤษพิมพ์บน keyboard ไทย (ต้องแปลง) 100% 105/105
ไทยถูกต้อง (ไม่ต้องแปลง) 100% 101/101
อังกฤษถูกต้อง (ไม่ต้องแปลง) 100% 103/103
แก้ไขคำสะกด (Beta) 95% ⚠️ 96/101
รวม 98% 405/410

5 เคสที่พลาด เป็นข้อจำกัดของ edit distance 1 (เช่น ตั้งแต่, มากกว่า ต้อง edit-2) ไม่ใช่ bug — ไม่มีคำถูกต้องถูกเปลี่ยน

ความเร็ว: 0.12ms ต่อเคส • แบต: แทบไม่มีผล • Memory: ~15MB


ภาพหน้าจอ

เร็วๆ นี้


🇬🇧 English

What This App Does

Detects when you type in the wrong keyboard language (e.g., typing "สวัสดี" but getting l;ylfu), deletes the wrong text, retypes it correctly, and switches the keyboard input source. Thai and English only.

Features

  • Detection and correction in <1ms
  • 100% on-device processing — no data sent anywhere, no keystroke logging
  • Low resource usage, negligible battery impact
  • Kedmanee and Pattachote layout support with auto-detection
  • Dictionary-based spell correction (Beta)
  • Liquid Glass UI on macOS 26
  • Thai and English interface, switchable instantly

How It Works

  1. Install — Drag zwitchType.app to /Applications
  2. Grant Permission — Open the app → Follow Welcome Screen → Grant Accessibility permission
  3. Just Type — The app runs in the menu bar. No configuration needed.
  4. Wrong Language? — The app detects, deletes, and retypes correctly.
  5. Manual Convert — Select text + hotkey to convert any text (names, brands, etc.)

Detection Technology

  • 242,608 English words — macOS built-in dictionary + 20k tech/modern words
  • 138,106 Thai words — TNC corpus with frequency data
  • Proper noun detection — Shift+letter patterns (e.g., "Ninja", "NASA")
  • O(1) hash lookup — Detection takes ~0.00001ms per word

All Features

Feature Description
Auto Language Switch Detects wrong keyboard language and corrects instantly
Manual Convert Select text + hotkey to convert between Thai ↔ English
Proper Noun Detection Shift+letter = names/brands, converts without dictionary
Spell Correction Off (default) / Dictionary (Beta)
Custom Dictionary Add/remove your own words for Thai and English
Excluded Apps Disable auto-switching for specific apps (Terminal, VS Code, etc.)
Clipboard Mode For apps where keystroke simulation doesn't work
Undo (Cmd+Z) Revert correction within 5 seconds
Launch at Login Start automatically on macOS login
Secure Input Auto-pauses in password fields
Health Monitor Auto-recovery when keystroke monitor stops

Spell Correction Modes

Mode Speed Accuracy Requirement
Off (default)
Dictionary (Beta) <1ms ~86% Any Mac

System Requirements

Minimum Recommended
macOS macOS 15+ macOS 26 (Tahoe)
Chip Intel or Apple Silicon Apple Silicon (M1+)
Permission Accessibility Accessibility
Languages Thai + English only Thai + English only
UI Standard Liquid Glass (macOS 26)

Performance

Metric Value
Detection Speed ~0.00001ms per word
Memory Usage ~15MB (dictionaries loaded)
CPU (idle) 0%
App Size ~5MB
Battery Impact Negligible

First Launch

This app is not notarized. macOS will show "Cannot be opened" on first launch.

  1. Open the app → macOS shows "Cannot be opened" → Click Done
  2. Open System Settings → Privacy & Security
  3. Scroll to Security → Click Open Anyway
  4. Click Open again → app launches

Alternative (Terminal): xattr -cr /Applications/zwitchType.app

Only needed once — macOS remembers after first launch.

Build from Source

git clone https://github.com/zuaq/zwitchType.git
cd zwitchType
open zwitchType.xcodeproj

Requires Xcode 16+ (Xcode 26 for Liquid Glass).


เครดิต / Acknowledgments

Component License Author
KeyboardShortcuts MIT Sindre Sorhus
LaunchAtLogin MIT Sindre Sorhus
SettingsAccess MIT Steffan Andrews
Thai word data Apache 2.0 PyThaiNLP
Thai frequency data Academic Thai National Corpus (TNC)
English word data Research Google Web Trillion Word Corpus via Josh Kaufman
Thai bigram data CC BY-SA Generated from Thai Wikipedia

สัญญาอนุญาต / License

CC BY-NC-SA 4.0 — Copyright © 2026 Yuttapong Sanannam

✅ อนุญาต ❌ ไม่อนุญาต
ใช้ส่วนตัว / Personal use ใช้เชิงพาณิชย์ / Commercial use
ศึกษาและดัดแปลง / Study & modify ขาย / Sell
แชร์พร้อม credit / Share with attribution ลบ credit / Remove attribution
Fork และร่วมพัฒนา / Fork & contribute เปลี่ยน license / Change license

สำหรับการใช้งานเชิงพาณิชย์ / For commercial licensing: ติดต่อ / Contact


แรงบันดาลใจ / Inspired by

Inspired by RightLang — zwitchType เป็นโปรเจกต์ open source ที่พัฒนาขึ้นใหม่ทั้งหมดด้วย Swift และ SwiftUI

Source code: github.com/zuaq/zwitchType


สร้างในประเทศไทย / Made in Thailand

About

แอปสลับภาษาอัตโนมัติ ไทย ↔ อังกฤษ สำหรับ Mac | Thai-English Auto Keyboard Switcher for macOS

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors