How tar3q-az1z/avro-keyboard works
1. Repository shape
- This is a Delphi 2010 codebase for a small suite of related Windows desktop tools centered on Avro Keyboard, a Bangla IME (input method editor).
- The repo is not one app: it contains a main keyboard engine plus companion executables for spell checking, layout editing, skin design, and a Unicode-to-Bijoy converter.
2. Main product boundary: Avro Keyboard
- The Keyboard and Spell checker project is the primary runtime application.
- It combines low-level input capture, transliteration, autocorrect, layout handling, update notification, and user configuration into one interactive system-tray style desktop app.
3. Core input pipeline
- User keystrokes are intercepted through keyboard-hook and virtual-key handling units, then routed into layout-specific processing.
- The key transformation path is phonetic Bangla typing: English keystrokes are interpreted by phonetic rules and converted into Bangla text.
- Supporting logic includes abbreviation expansion, keyboard macros, auto-correction, and edit-distance / regex-based suggestion search.
4. Shared engine and language logic
- The Classes and Units folders hold most of the reusable engine code.
- Important responsibilities here include:
- phonetic rule generation and matching,
- Bangla character mapping,
- layout abstraction,
- Levenshtein/similarity ranking,
- process/window interaction,
- file/folder and locale helpers,
- registry or XML-backed settings.
5. Configuration and persistence
- Settings are split between registry-based and XML-based handling, reflecting the app’s standard vs portable modes.
- ProjectDefines.inc controls that packaging choice; this affects where runtime state is stored and how the app behaves when deployed.
- NativeXml is part of the source tree and is used for structured config/storage.
6. UI layer in the main app
- The Forms directory contains the visible shell and dialogs: options, about, update notification, conflict handling, layout viewer, spell/auto-correct related dialogs, splash screen, and toolbar components.
- These forms are mostly presentation wrappers around the shared engine rather than separate business logic layers.
7. Layout and skin subsystem
- Layouts and skins are first-class concepts, not just themes.
- Runtime code loads keyboard layouts and skin resources from internal .rc/.res assets and from files handled by KeyboardLayoutLoader and SkinLoader.
- The layout/skin converters bridge designer tools and runtime formats, so layout assets can be edited externally and consumed by the keyboard app.
8. Companion tool: Layout Editor
- Layout Editor is a separate executable for editing keyboard layouts.
- It reuses the same registry/settings and skin/layout conversion code, which indicates the editor writes data consumed directly by the main IME.
9. Companion tool: Skin Designer
- Skin Designer is another standalone desktop tool for creating the visual skin assets used by the keyboard runtime.
- It includes image/frame editing helpers and a skin creation form, showing that skinning is a packaged asset pipeline separate from the IME’s core typing logic.
10. Spell checker subsystem
- The SpellChecker project is a distinct executable focused on spelling assistance.
- It has its own forms and engine code for:
- dictionary lookup,
- custom dictionaries,
- clipboard interaction,
- phonetic and regex-based search,
- edit-distance ranking,
- suggestion generation.
- This is a separate boundary from the main keyboard app, though it uses the same Bangla/phonetic domain logic.
11. Spell checking dependencies
- The spell checker includes hashing, memo parsing, reverse phonetic matching, and suggestion builders.
- The presence of DISQLite3 in the README suggests dictionary or linguistic data may be persisted through SQLite-backed storage in parts of the system, even if the exact database access is abstracted by local units.
12. Utility tool: Unicode to Bijoy converter
- Unicode to ascii converter is a lightweight standalone converter from Unicode Bangla text to Bijoy encoding.
- It shares the same language-domain knowledge but is operationally isolated from the IME runtime.
13. External libraries and platform dependencies
- The repo depends on Delphi Windows desktop infrastructure plus several external libraries that materially shape the architecture:
- PCRE for regex-driven phonetic matching,
- NativeXml for structured settings/data,
- DISQLite3 for database access,
- ICS and JEDI (JVCL/JCL) as supporting Delphi frameworks.
- These are not incidental: they underpin search, configuration, and integration features.
14. Resource packaging
- Icons, skins, layouts, and form assets are compiled into resource files (.rc, .res, .rsb) and loaded at runtime.
- That means the architecture relies heavily on embedded assets plus a few editable external formats rather than web services or cloud dependencies.
15. Overall architectural picture
- At the center is a Windows input method engine with a phonetic conversion core.
- Around it are configuration/storage, input/system integration, visual skin/layout management, and spell-check/suggestion subsystems.
- Separate tools exist to author the data consumed by the runtime, making this a small ecosystem of tightly related Delphi executables rather than a single monolithic app.
Main entry points: Avro_Keyboard.dpr Main app · clsSkinLayoutConverter.pas Layout/skin bridge · clsAvroPhonetic.pas Phonetic core · uRegistrySettings.pas Settings
Components 22
Avro Keyboard
Primary keyboard IME runtime and its UI/settings flow.
- Main app · Primary Avro Keyboard runtime entry point.
Keyboard and Spell checker/Avro_Keyboard.dpr - Main forms · Options, update, conflict, layout, and tray dialogs.
Keyboard and Spell checker/Forms/uForm1.pas - Runtime assets · Compiled layouts, skins, icons, and form resources.
Keyboard and Spell checker/Avro_Keyboard.rc
Spell Checker
Standalone spelling assistance executable and its suggestion engine.
- Spell app · Standalone spell-checking application entry point.
Keyboard and Spell checker/SpellChecker/Avro_Spell_Checker.dpr - Spell engine · Dictionary lookup, memo parsing, and suggestion building.
Keyboard and Spell checker/SpellChecker/clsSpellPhoneticSuggestionBuilder.pas - Spell search · Edit-distance, regex, and reverse phonetic matching.
Keyboard and Spell checker/SpellChecker/uSpellEditDistanceSearch.pas - Dictionary store · Custom dictionary and persistence layer.
Keyboard and Spell checker/SpellChecker/uCustomDictionary.pas - Spell forms · Spell checker dialogs, popup, and options.
Keyboard and Spell checker/SpellChecker/ufrmSpell.pas
Authoring Tools
Separate desktop tools for layout and skin creation.
- Layout editor · Standalone layout authoring tool.
Layout Editor/LayoutEditor.dpr - Skin designer · Standalone skin authoring tool.
Skin Designer/SkinDesigner.dpr - Bijoy converter · Unicode Bangla to Bijoy encoding converter.
Unicode to ascii converter/Unicode_to_Bijoy.dpr
Shared Engine
Reusable language, input, and integration units shared across executables.
- Input hook · Interprets low-level keystrokes and virtual keys.
Keyboard and Spell checker/Units/KeyboardHook.pas - Key funcs · Keyboard utility logic and key translation helpers.
Keyboard and Spell checker/Units/KeyboardFunctions.pas - Phonetic core · Phonetic Bangla conversion and rule matching.
Keyboard and Spell checker/Classes/clsAvroPhonetic.pas - Layout loader · Loads and applies keyboard layouts.
Keyboard and Spell checker/Units/KeyboardLayoutLoader.pas - Skin loader · Loads visual skin resources for the IME shell.
Keyboard and Spell checker/Units/SkinLoader.pas - Auto-correct · Abbreviation expansion, macros, and correction logic.
Keyboard and Spell checker/Units/uAutoCorrect.pas - Search engine · Regex-driven phonetic and edit-distance suggestion search.
Keyboard and Spell checker/Units/uRegExPhoneticSearch.pas - Settings · Registry/XML-backed configuration and portable-mode state.
Keyboard and Spell checker/Units/uRegistrySettings.pas - Layout model · Layout abstractions and Bangla/English mapping structures.
Keyboard and Spell checker/Classes/clsLayout.pas - OS bridge · Process, window, and system interaction helpers.
Keyboard and Spell checker/Units/uProcessHandler.pas - Layout/skin bridge · Converts between editable authoring formats and runtime resources.
Keyboard and Spell checker/Classes/clsSkinLayoutConverter.pas
Connections 24
- Main app → Input hook: captures keys · The main IME starts by intercepting keyboard input.
- Main app → Main forms: shows UI · Launches tray dialogs, options, and notifications.
- Input hook → Key funcs: normalizes input · Captured events are converted into usable key state.
- Key funcs → Phonetic core: routes typing · Keystrokes are handed to phonetic Bangla conversion.
- Phonetic core → Layout model: applies rules · Transliteration depends on layout-specific mappings.
- Layout model → Layout loader: loads layouts · Layout definitions are materialized at runtime.
- Main app → Auto-correct: assists typing · Macro and abbreviation logic enrich the input pipeline.
- Auto-correct → Search engine: suggests matches · Correction uses regex and similarity-based lookup.
- Search engine → Phonetic core: shares phonetics · Search reuses the same Bangla phonetic rules.
- Main app → Settings: reads config · Runtime behavior is driven by registry or XML settings.
- Settings → OS bridge: integrates OS · Settings support process/window and environment interaction.
- Main app → Skin loader: loads skin · The shell applies runtime skin resources.
- Skin loader → Runtime assets: uses assets · Skin and layout data are packaged in embedded resources.
- Layout/skin bridge → Layout loader: bridges formats · Authoring data is converted into runtime layout assets.
- Layout/skin bridge → Skin loader: bridges formats · Skin authoring output feeds the runtime loader.
- Layout editor → Layout/skin bridge: edits layouts · Layout Editor writes data consumed by the IME.
- Layout editor → Settings: shares config · Uses the same configuration conventions as the runtime.
- Skin designer → Layout/skin bridge: builds skins · Skin Designer creates assets for the keyboard runtime.
- Spell app → Spell engine: runs engine · Spell checker entry point starts suggestion generation.
- Spell engine → Spell search: ranks results · Suggestions are ranked through search and edit distance.
- Spell search → Dictionary store: looks up words · Search consults the dictionary store for candidates.
- Spell app → Spell forms: shows dialogs · Spell checker provides dedicated forms and popups.
- Spell app → Settings: reuses config · Spell checker shares registry/XML settings patterns.
- Bijoy converter → Phonetic core: shares domain · Unicode-to-Bijoy conversion uses the same Bangla language knowledge.