# yanglx2022/tinyhotkeytool architecture

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

- Interactive diagram: https://gitdiagram.com/yanglx2022/tinyhotkeytool
- Repository: https://github.com/yanglx2022/tinyhotkeytool

## Overview

TinyHotkeyTool is a background Windows utility: it reads shortcut definitions, registers global hotkeys, and responds by launching configured commands or handling special actions. The README documents startup prompting, clipboard arguments, exit confirmation, and elevation behavior. The source file was not excerpted, so the graph uses only README-documented relationships and does not infer internal calls.

Main entry points: [`shortcut.cpp`](https://github.com/yanglx2022/tinyhotkeytool/blob/master/shortcut.cpp) (Shortcut actions), [`setting.ini`](https://github.com/yanglx2022/tinyhotkeytool/blob/master/setting.ini) (Hotkey settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup_config["Startup and configuration"]
  node_settings["Hotkey settings<br/>[setting.ini]"]
  node_startup["Startup prompt<br/>[shortcut.cpp]"]
  node_config["Config handling<br/>[shortcut.cpp]"]
end

subgraph group_hotkey_runtime["Hotkey runtime"]
  node_registration["Hotkey registration<br/>[shortcut.cpp]"]
  node_listener["Background listener<br/>[shortcut.cpp]"]
  node_dispatch["Shortcut actions<br/>[shortcut.cpp]"]
end

subgraph group_actions["Command actions"]
  node_process["Command launching<br/>[shortcut.cpp]"]
  node_clipboard["Clipboard arguments<br/>[shortcut.cpp]"]
  node_elevation["Privilege elevation<br/>[shortcut.cpp]"]
  node_exit["Exit confirmation<br/>[shortcut.cpp]"]
end

node_user(("User"))
node_windows["Windows"]
node_configured_apps["Configured programs"]

node_user -->|"starts"| node_startup
node_startup -->|"prompts"| node_user
node_config -->|"reads"| node_settings
node_config -->|"configures"| node_registration
node_registration -->|"registers hotkeys"| node_windows
node_windows -->|"signals hotkeys"| node_listener
node_listener -->|"dispatches"| node_dispatch
node_dispatch -->|"launches commands"| node_process
node_process -->|"starts programs"| node_configured_apps
node_dispatch -->|"uses clipboard"| node_clipboard
node_clipboard -->|"provides arguments"| node_process
node_dispatch -->|"handles elevation"| node_elevation
node_dispatch -->|"handles exit"| node_exit
node_user -->|"confirms exit"| node_exit

click node_settings "https://github.com/yanglx2022/tinyhotkeytool/blob/master/setting.ini"
click node_startup "https://github.com/yanglx2022/tinyhotkeytool/blob/master/shortcut.cpp"
click node_config "https://github.com/yanglx2022/tinyhotkeytool/blob/master/shortcut.cpp"
click node_registration "https://github.com/yanglx2022/tinyhotkeytool/blob/master/shortcut.cpp"
click node_listener "https://github.com/yanglx2022/tinyhotkeytool/blob/master/shortcut.cpp"
click node_dispatch "https://github.com/yanglx2022/tinyhotkeytool/blob/master/shortcut.cpp"
click node_process "https://github.com/yanglx2022/tinyhotkeytool/blob/master/shortcut.cpp"
click node_clipboard "https://github.com/yanglx2022/tinyhotkeytool/blob/master/shortcut.cpp"
click node_elevation "https://github.com/yanglx2022/tinyhotkeytool/blob/master/shortcut.cpp"
click node_exit "https://github.com/yanglx2022/tinyhotkeytool/blob/master/shortcut.cpp"

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_settings,node_startup,node_config,node_user toneBlue
class node_registration,node_listener,node_dispatch toneAmber
class node_process,node_clipboard,node_elevation,node_exit toneMint
class node_windows,node_configured_apps toneIndigo
```

## Components

### Startup and configuration

- [Hotkey settings](https://github.com/yanglx2022/tinyhotkeytool/blob/master/setting.ini): `setting.ini`
- [Startup prompt](https://github.com/yanglx2022/tinyhotkeytool/blob/master/shortcut.cpp): `shortcut.cpp`
- [Config handling](https://github.com/yanglx2022/tinyhotkeytool/blob/master/shortcut.cpp): `shortcut.cpp`

### Hotkey runtime

- [Hotkey registration](https://github.com/yanglx2022/tinyhotkeytool/blob/master/shortcut.cpp): `shortcut.cpp`
- [Background listener](https://github.com/yanglx2022/tinyhotkeytool/blob/master/shortcut.cpp): `shortcut.cpp`
- [Shortcut actions](https://github.com/yanglx2022/tinyhotkeytool/blob/master/shortcut.cpp): `shortcut.cpp`

### Command actions

- [Command launching](https://github.com/yanglx2022/tinyhotkeytool/blob/master/shortcut.cpp): `shortcut.cpp`
- [Clipboard arguments](https://github.com/yanglx2022/tinyhotkeytool/blob/master/shortcut.cpp): `shortcut.cpp`
- [Privilege elevation](https://github.com/yanglx2022/tinyhotkeytool/blob/master/shortcut.cpp): `shortcut.cpp`
- [Exit confirmation](https://github.com/yanglx2022/tinyhotkeytool/blob/master/shortcut.cpp): `shortcut.cpp`

### Other components

- **User**
- **Windows**
- **Configured programs**

## Connections

- User → Startup prompt: starts (evidence: `README.md`)
- Startup prompt → User: prompts (evidence: `README.md`)
- Config handling → Hotkey settings: reads (evidence: `README.md`)
- Config handling → Hotkey registration: configures (evidence: `README.md`)
- Hotkey registration → Windows: registers hotkeys (evidence: `README.md`)
- Windows → Background listener: signals hotkeys (evidence: `README.md`)
- Background listener → Shortcut actions: dispatches (evidence: `README.md`)
- Shortcut actions → Command launching: launches commands (evidence: `README.md`)
- Command launching → Configured programs: starts programs (evidence: `README.md`)
- Shortcut actions → Clipboard arguments: uses clipboard (evidence: `README.md`)
- Clipboard arguments → Command launching: provides arguments (evidence: `README.md`)
- Shortcut actions → Privilege elevation: handles elevation (evidence: `README.md`)
- Shortcut actions → Exit confirmation: handles exit (evidence: `README.md`)
- User → Exit confirmation: confirms exit (evidence: `README.md`)
