Documentation Index
Fetch the complete documentation index at: https://mintlify.com/khaphanspace/gonhanh.org/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Gõ Nhanh provides two intelligent switching features:- Per-App Mode: Remembers ON/OFF state for each application
- Input Source Following: Auto-disables when switching to non-Latin input sources
Per-App Mode Switching
How It Works
Gõ Nhanh remembers your Vietnamese mode preference (ON/OFF) separately for each application.No manual toggling needed! Just set it once per app, and Gõ Nhanh remembers.
Example Workflow
Implementation Details
The per-app mode is implemented inInputSourceManager.swift and PerAppConfigModels.swift:
Automatic Input Source Following
What It Does
Gõ Nhanh automatically disables when you switch to non-Latin input sources and re-enables when you switch back to English/Latin.Supported Input Sources
- Auto-Disable
- Auto-Enable
Gõ Nhanh disables when switching to:
- East Asian: Japanese (あ), Chinese (中), Korean (한)
- Southeast Asian: Thai (ก), Khmer (ក), Lao (ກ), Myanmar (က)
- South Asian: Hindi (अ), Bengali (অ), Tamil (அ)
- Middle Eastern: Arabic (ع), Hebrew (א), Persian (ف)
- Other: Russian (Р), Greek (Ω), Vietnamese IME (E)
Language Detection
The system checks the input source’s primary language code:platforms/macos/InputSourceManager.swift
Menu Bar Icon
The menu bar icon changes to show the current input source:| Input Source | Icon | Description |
|---|---|---|
| English (default) | V | Vietnamese mode ready |
| Japanese | あ | Japanese input active |
| Chinese | 中 | Chinese input active |
| Korean | 한 | Korean input active |
| Thai | ก | Thai input active |
| Arabic | ع | Arabic input active |
The icon updates in real-time when you switch input sources.
Per-App Configuration
Access Settings
- Click Gõ Nhanh icon in menu bar
- Select Settings → Advanced
- Go to “Per-app configuration” section
Available Options
Enabled State
Enabled State
- Auto (0): Follow global setting
- On (1): Always enable for this app
- Off (-1): Always disable for this app
Delay Preset
Delay Preset
Adjust typing delay for apps with slow input handling (e.g., Electron apps):
Injection Override
Injection Override
Force a specific text injection method:Most users should keep this on Auto.
Use Cases
For Developers
For Multilingual Users
For Content Creators
Troubleshooting
Mode doesn't switch automatically
Mode doesn't switch automatically
- Check Settings → Advanced → Per-app configuration
- Make sure
enabledStateis set to Auto (not forced ON/OFF) - Try toggling the mode manually once for that app
Input source following doesn't work
Input source following doesn't work
- Ensure you’re using macOS Input Sources (not third-party IMEs)
- Check System Settings → Keyboard → Input Sources
- Restart Gõ Nhanh
Characters eating in IDE
Characters eating in IDE
Increase delay preset:
- Settings → Advanced → Per-app config
- Click + → Select your IDE
- Set Delay to “Rất cao” (Very High)
Technical Architecture
Observer Pattern
Gõ Nhanh usesCFNotificationCenter to observe input source changes:
State Management
Per-app state is stored inUserDefaults and synchronized with the Rust engine:
Related Features
Auto-Restore
Automatic English word restoration
Configuration
Customize all settings