How hrishikesh-coder/bangla_keyboard works
Shobdomala is a Windows system-wide Bengali IME: a user types Roman keys in a focused application, the global hook captures them, and the active input mode produces Bengali text that is injected back into that application. Phonetic mode tokenizes and context-resolves candidates before Unicode composition; fixed-layout mode maps keys directly. The product also supports candidate selection, prediction/correction, macros, special characters, settings, and UI controls. Some subsystem links follow README documentation or declarations because their implementation excerpts were not sampled.
Main entry points: KeyboardHook.cpp Keyboard hook · main.cpp Application setup · PhoneticEngine.cpp Phonetic engine · CandidateResolver.cpp Candidate resolver
Components 26
Input capture
- Keyboard hook
src/native/KeyboardHook.cpp - Roman input buffer
src/core/InputBuffer.cpp - Mode and shortcuts
src/native/KeyboardState.cpp
Transliteration engine
- Phonetic engine
src/core/PhoneticEngine.cpp - Longest-match tokenizer
src/core/Tokenizer.cpp - Context analysis
src/core/ContextAnalyzer.cpp - Symbol rules
src/core/SymbolTable.cpp - Word exceptions
src/core/ExceptionDictionary.cpp - Unicode composer
src/core/UnicodeComposer.cpp - Fixed layout
src/core/FixedLayoutEngine.cpp - Special characters
src/core/SpecialCharPicker.cpp
Typing assistance
- Word dictionary
src/core/WordDictionary.cpp - Candidate resolver
src/core/CandidateResolver.cpp - Suggestion policy
src/core/SuggestionPolicy.cpp - N-gram model
src/core/NgramModel.cpp - User dictionary
src/core/UserDictionary.cpp - Macro engine
src/core/MacroEngine.cpp
User interface
- Candidate window
src/ui/CandidateWindow.cpp - Tray controls
src/ui/TrayIcon.cpp - On-screen keyboard
src/ui/OnScreenKeyboard.cpp - Macro dialog
src/ui/MacroDialog.cpp
Windows integration
- Application setup
src/main.cpp - Settings
src/native/Settings.cpp - Unicode injector
src/native/InputInjector.cpp
Other components
- Typist
- Focused app
Connections 31
- Typist → Keyboard hook: presses keys
- Keyboard hook → Roman input buffer: buffers input
- Keyboard hook → Mode and shortcuts: checks mode
- Keyboard hook → Phonetic engine: requests composition
- Keyboard hook → Fixed layout: maps keys
- Keyboard hook → Special characters: opens picker
- Phonetic engine → Longest-match tokenizer: tokenizes
- Phonetic engine → Context analysis: analyzes context
- Phonetic engine → Symbol rules: looks up rules
- Phonetic engine → Word exceptions: checks overrides
- Phonetic engine → Unicode composer: composes text
- Application setup → Phonetic engine: loads rules
- Application setup → Fixed layout: loads layout
- Keyboard hook → Candidate window: updates display
- Candidate window → Keyboard hook: selects candidate
- Keyboard hook → Word dictionary: queries words
- Keyboard hook → Candidate resolver: resolves candidates
- Application setup → Candidate resolver: configures resolver
- Candidate resolver → Word dictionary: looks up words
- Keyboard hook → Suggestion policy: requests suggestions
- Suggestion policy → N-gram model: scores context
- Keyboard hook → User dictionary: records corrections
- Keyboard hook → Macro engine: expands shortcut
- Application setup → Settings: loads and saves
- Application setup → Keyboard hook: installs hook
- Application setup → Tray controls: initializes controls
- Application setup → On-screen keyboard: initializes keyboard
- Application setup → Macro dialog: initializes dialog
- Keyboard hook → Unicode injector: injects composed text
- Unicode injector → Focused app: sends Unicode
- Typist → Focused app: types in