# mchaworks/glimkey architecture

> Architecture diagram of the GitHub repository mchaworks/glimkey, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mchaworks/glimkey
- Repository: https://github.com/mchaworks/glimkey

## Overview

Glimkey is an Android on-screen keyboard. Its principal workflow is typing in a host app: the keyboard service presents keys, commits input, and offers learned suggestions and correction; optional strip tools add emoji, translation, clipboard, and editing. Settings control appearance and typing behavior. The graph retains documented theme, animation, and feedback capabilities. Service internals were only partially excerpted, so unverified runtime links are dashed rather than presented as inspected calls.

Main entry points: [`app/src/main/java/dev/pillboard/keyboard/PillboardService.kt`](https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/PillboardService.kt) (Keyboard service), [`app/src/main/java/dev/pillboard/keyboard/KeyView.kt`](https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/KeyView.kt) (Key interaction), [`app/src/main/java/dev/pillboard/keyboard/SuggestCore.kt`](https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/SuggestCore.kt) (Prediction engine), [`app/src/main/java/dev/pillboard/keyboard/SettingsActivity.kt`](https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/SettingsActivity.kt) (Settings screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Keyboard runtime"]
  node_service["Keyboard service"]
  node_keys["Key interaction<br/>[KeyView.kt]"]
  node_emoji["Emoji picker<br/>[EmojiGridView.kt]"]
  node_emoji_data["Emoji catalog<br/>[EmojiData.kt]"]
end

subgraph group_language["Language tools"]
  node_suggestions["Suggestion UI<br/>[Suggestions.kt]"]
  node_suggest_core["Prediction engine<br/>[SuggestCore.kt]"]
  node_lexicon["Built-in lexicon<br/>[Lexicon.kt]"]
  node_user_model[("Learned vocabulary<br/>[UserModel.kt]")]
  node_translator["Translation tool<br/>[Translator.kt]"]
end

subgraph group_appearance["Appearance and feedback"]
  node_themes["Theme palettes<br/>[KbTheme.kt]"]
  node_tokens["Keyboard styling<br/>[KbTokens.kt]"]
  node_key_draw["Key rendering<br/>[KeyBodyDrawable.kt]"]
  node_tap_fx["Tap effects<br/>[TapFx.kt]"]
  node_sound["Typing sounds<br/>[TypingSound.kt]"]
  node_haptics["Haptic feedback<br/>[Haptics.kt]"]
  node_blur_text["Blur transitions<br/>[BlurTextTokens.kt]"]
end

subgraph group_configuration["Settings"]
  node_settings["Settings screen"]
  node_settings_ui["Settings controls<br/>[SettingsUi.kt]"]
  node_prefs[("Preferences<br/>[Prefs.kt]")]
end

node_user(("Keyboard user"))
node_host["Host app"]
node_ime["Android input system"]

node_user -->|"selects keyboard"| node_ime
node_ime -.->|"activates"| node_service
node_user -->|"types with"| node_keys
node_service -.->|"hosts keys"| node_keys
node_service -.->|"commits input"| node_host
node_service -.->|"shows suggestions"| node_suggestions
node_suggestions -->|"requests candidates"| node_suggest_core
node_suggest_core -->|"uses words"| node_lexicon
node_suggest_core -->|"uses learned data"| node_user_model
node_service -.->|"opens picker"| node_emoji
node_emoji -->|"displays catalog"| node_emoji_data
node_service -->|"offers translation"| node_translator
node_user -->|"configures keyboard"| node_settings
node_settings -->|"builds controls"| node_settings_ui
node_settings -.->|"changes preferences"| node_prefs
node_service -->|"supports themes"| node_themes
node_keys -->|"draws keycaps"| node_key_draw
node_keys -->|"uses styling"| node_tokens
node_service -->|"offers tap effects"| node_tap_fx
node_service -->|"plays theme sounds"| node_sound
node_service -->|"provides haptics"| node_haptics
node_keys -.->|"animates labels"| node_blur_text

click node_service "https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/PillboardService.kt"
click node_keys "https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/KeyView.kt"
click node_emoji "https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/EmojiGridView.kt"
click node_emoji_data "https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/EmojiData.kt"
click node_suggestions "https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/Suggestions.kt"
click node_suggest_core "https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/SuggestCore.kt"
click node_lexicon "https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/Lexicon.kt"
click node_user_model "https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/UserModel.kt"
click node_translator "https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/Translator.kt"
click node_themes "https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/KbTheme.kt"
click node_tokens "https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/KbTokens.kt"
click node_key_draw "https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/KeyBodyDrawable.kt"
click node_tap_fx "https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/TapFx.kt"
click node_sound "https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/TypingSound.kt"
click node_haptics "https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/Haptics.kt"
click node_blur_text "https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/BlurTextTokens.kt"
click node_settings "https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/SettingsActivity.kt"
click node_settings_ui "https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/SettingsUi.kt"
click node_prefs "https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/Prefs.kt"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_service,node_keys,node_emoji,node_emoji_data,node_user toneBlue
class node_suggestions,node_suggest_core,node_lexicon,node_user_model,node_translator toneAmber
class node_themes,node_tokens,node_key_draw,node_tap_fx,node_sound,node_haptics,node_blur_text toneMint
class node_settings,node_settings_ui,node_prefs toneRose
class node_host,node_ime toneIndigo
```

## Components

### Keyboard runtime

- [Keyboard service](https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/PillboardService.kt): `app/src/main/java/dev/pillboard/keyboard/PillboardService.kt`
- [Key interaction](https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/KeyView.kt): `app/src/main/java/dev/pillboard/keyboard/KeyView.kt`
- [Emoji picker](https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/EmojiGridView.kt): `app/src/main/java/dev/pillboard/keyboard/EmojiGridView.kt`
- [Emoji catalog](https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/EmojiData.kt): `app/src/main/java/dev/pillboard/keyboard/EmojiData.kt`

### Language tools

- [Suggestion UI](https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/Suggestions.kt): `app/src/main/java/dev/pillboard/keyboard/Suggestions.kt`
- [Prediction engine](https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/SuggestCore.kt): `app/src/main/java/dev/pillboard/keyboard/SuggestCore.kt`
- [Built-in lexicon](https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/Lexicon.kt): `app/src/main/java/dev/pillboard/keyboard/Lexicon.kt`
- [Learned vocabulary](https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/UserModel.kt): `app/src/main/java/dev/pillboard/keyboard/UserModel.kt`
- [Translation tool](https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/Translator.kt): `app/src/main/java/dev/pillboard/keyboard/Translator.kt`

### Appearance and feedback

- [Theme palettes](https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/KbTheme.kt): `app/src/main/java/dev/pillboard/keyboard/KbTheme.kt`
- [Keyboard styling](https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/KbTokens.kt): `app/src/main/java/dev/pillboard/keyboard/KbTokens.kt`
- [Key rendering](https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/KeyBodyDrawable.kt): `app/src/main/java/dev/pillboard/keyboard/KeyBodyDrawable.kt`
- [Tap effects](https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/TapFx.kt): `app/src/main/java/dev/pillboard/keyboard/TapFx.kt`
- [Typing sounds](https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/TypingSound.kt): `app/src/main/java/dev/pillboard/keyboard/TypingSound.kt`
- [Haptic feedback](https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/Haptics.kt): `app/src/main/java/dev/pillboard/keyboard/Haptics.kt`
- [Blur transitions](https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/BlurTextTokens.kt): `app/src/main/java/dev/pillboard/keyboard/BlurTextTokens.kt`

### Settings

- [Settings screen](https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/SettingsActivity.kt): `app/src/main/java/dev/pillboard/keyboard/SettingsActivity.kt`
- [Settings controls](https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/SettingsUi.kt): `app/src/main/java/dev/pillboard/keyboard/SettingsUi.kt`
- [Preferences](https://github.com/mchaworks/glimkey/blob/main/app/src/main/java/dev/pillboard/keyboard/Prefs.kt): `app/src/main/java/dev/pillboard/keyboard/Prefs.kt`

### Other components

- **Keyboard user**
- **Host app**
- **Android input system**

## Connections

- Keyboard user → Android input system: selects keyboard
- Android input system → Keyboard service: activates
- Keyboard user → Key interaction: types with
- Keyboard service → Key interaction: hosts keys (evidence: `app/src/main/java/dev/pillboard/keyboard/PillboardService.kt`)
- Keyboard service → Host app: commits input
- Keyboard service → Suggestion UI: shows suggestions (evidence: `app/src/main/java/dev/pillboard/keyboard/PillboardService.kt`)
- Suggestion UI → Prediction engine: requests candidates (evidence: `app/src/main/java/dev/pillboard/keyboard/Suggestions.kt`)
- Prediction engine → Built-in lexicon: uses words (evidence: `app/src/main/java/dev/pillboard/keyboard/SuggestCore.kt`)
- Prediction engine → Learned vocabulary: uses learned data (evidence: `app/src/main/java/dev/pillboard/keyboard/SuggestCore.kt`)
- Keyboard service → Emoji picker: opens picker (evidence: `app/src/main/java/dev/pillboard/keyboard/PillboardService.kt`)
- Emoji picker → Emoji catalog: displays catalog (evidence: `app/src/main/java/dev/pillboard/keyboard/EmojiGridView.kt`)
- Keyboard service → Translation tool: offers translation (evidence: `app/src/main/java/dev/pillboard/keyboard/PillboardService.kt`)
- Keyboard user → Settings screen: configures keyboard
- Settings screen → Settings controls: builds controls (evidence: `app/src/main/java/dev/pillboard/keyboard/SettingsActivity.kt`)
- Settings screen → Preferences: changes preferences (evidence: `app/src/main/java/dev/pillboard/keyboard/SettingsActivity.kt`)
- Keyboard service → Theme palettes: supports themes (evidence: `app/src/main/java/dev/pillboard/keyboard/PillboardService.kt`)
- Key interaction → Key rendering: draws keycaps (evidence: `app/src/main/java/dev/pillboard/keyboard/KeyView.kt`)
- Key interaction → Keyboard styling: uses styling (evidence: `app/src/main/java/dev/pillboard/keyboard/KeyView.kt`)
- Keyboard service → Tap effects: offers tap effects
- Keyboard service → Typing sounds: plays theme sounds (evidence: `app/src/main/java/dev/pillboard/keyboard/PillboardService.kt`)
- Keyboard service → Haptic feedback: provides haptics (evidence: `app/src/main/java/dev/pillboard/keyboard/PillboardService.kt`)
- Key interaction → Blur transitions: animates labels (evidence: `app/src/main/java/dev/pillboard/keyboard/KeyView.kt`)
