# thnoed/damnclick architecture

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

- Interactive diagram: https://gitdiagram.com/thnoed/damnclick
- Repository: https://github.com/thnoed/damnclick

## Overview

DamnClick is a Windows game auto-clicker with configurable profiles and click binds. Users select a profile, configure and enable binds, then trigger Hold, Toggle, or Combo behavior with global keyboard or mouse input; the runner injects timed clicks into the foreground application. The app also supports profile import/export, settings, status display, localization, and toggle sounds. Relationships below follow the excerpts, SOURCE INDEX references, and README; unsampled UI and settings details are represented at their enclosing source path.

Main entry points: [`MainWindow.xaml.cs`](https://github.com/thnoed/damnclick/blob/main/MainWindow.xaml.cs) (Main window), [`Core/BlockRunner.cs`](https://github.com/thnoed/damnclick/blob/main/Core/BlockRunner.cs) (Click runner), [`BlockCard.xaml.cs`](https://github.com/thnoed/damnclick/blob/main/BlockCard.xaml.cs) (Bind editor), [`Core/GlobalHook.cs`](https://github.com/thnoed/damnclick/blob/main/Core/GlobalHook.cs) (Global input hook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["App interface"]
  node_window["Main window<br/>[MainWindow.xaml.cs]"]
  node_bindcard["Bind editor<br/>[BlockCard.xaml.cs]"]
  node_localization["Localization<br/>[I18n.cs]"]
end

subgraph group_runtime["Click runtime"]
  node_runner["Click runner<br/>[BlockRunner.cs]"]
  node_hook["Global input hook<br/>[GlobalHook.cs]"]
  node_keystate["Key state<br/>[KeyState.cs]"]
  node_keycodes["Key encoding<br/>[KeyCodes.cs]"]
  node_win32["Input and timing API<br/>[Win32.cs]"]
  node_sounds["Toggle sounds<br/>[SoundBank.cs]"]
end

subgraph group_data["Profiles and settings"]
  node_profiledata["Profile models<br/>[Models.cs]"]
  node_store[("Profile storage<br/>[ProfileStore.cs]")]
end

node_user(("User"))
node_windows{{"Windows input APIs"}}
node_game["Game or foreground app"]
node_profilefile[("profiles.dat")]

node_user -->|"configures"| node_window
node_window -->|"loads and saves"| node_store
node_store -->|"reads and writes"| node_profilefile
node_store -->|"serializes"| node_profiledata
node_window -->|"creates"| node_bindcard
node_bindcard -->|"refreshes"| node_runner
node_bindcard -->|"gets labels"| node_localization
node_window -->|"gets labels"| node_localization
node_window -->|"creates"| node_runner
node_window -->|"starts"| node_hook
node_hook -->|"sends key events"| node_runner
node_hook -->|"encodes input"| node_keycodes
node_runner -->|"checks held key"| node_keystate
node_keystate -->|"converts key"| node_keycodes
node_keystate -->|"checks physical state"| node_win32
node_runner -->|"injects timed clicks"| node_win32
node_win32 -->|"calls input APIs"| node_windows
node_windows -.->|"delivers clicks"| node_game
node_window -->|"uses toggle sounds"| node_sounds

click node_window "https://github.com/thnoed/damnclick/blob/main/MainWindow.xaml.cs"
click node_bindcard "https://github.com/thnoed/damnclick/blob/main/BlockCard.xaml.cs"
click node_localization "https://github.com/thnoed/damnclick/blob/main/Core/I18n.cs"
click node_profiledata "https://github.com/thnoed/damnclick/blob/main/Core/Models.cs"
click node_store "https://github.com/thnoed/damnclick/blob/main/Core/ProfileStore.cs"
click node_runner "https://github.com/thnoed/damnclick/blob/main/Core/BlockRunner.cs"
click node_hook "https://github.com/thnoed/damnclick/blob/main/Core/GlobalHook.cs"
click node_keystate "https://github.com/thnoed/damnclick/blob/main/Core/KeyState.cs"
click node_keycodes "https://github.com/thnoed/damnclick/blob/main/Core/KeyCodes.cs"
click node_win32 "https://github.com/thnoed/damnclick/blob/main/Core/Win32.cs"
click node_sounds "https://github.com/thnoed/damnclick/blob/main/Core/SoundBank.cs"

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_window,node_bindcard,node_localization,node_user toneBlue
class node_runner,node_hook,node_keystate,node_keycodes,node_win32,node_sounds,node_profilefile toneAmber
class node_profiledata,node_store,node_windows toneMint
class node_game toneIndigo
```

## Components

### App interface

- [Main window](https://github.com/thnoed/damnclick/blob/main/MainWindow.xaml.cs): `MainWindow.xaml.cs`
- [Bind editor](https://github.com/thnoed/damnclick/blob/main/BlockCard.xaml.cs): `BlockCard.xaml.cs`
- [Localization](https://github.com/thnoed/damnclick/blob/main/Core/I18n.cs): `Core/I18n.cs`

### Click runtime

- [Click runner](https://github.com/thnoed/damnclick/blob/main/Core/BlockRunner.cs): `Core/BlockRunner.cs`
- [Global input hook](https://github.com/thnoed/damnclick/blob/main/Core/GlobalHook.cs): `Core/GlobalHook.cs`
- [Key state](https://github.com/thnoed/damnclick/blob/main/Core/KeyState.cs): `Core/KeyState.cs`
- [Key encoding](https://github.com/thnoed/damnclick/blob/main/Core/KeyCodes.cs): `Core/KeyCodes.cs`
- [Input and timing API](https://github.com/thnoed/damnclick/blob/main/Core/Win32.cs): `Core/Win32.cs`
- [Toggle sounds](https://github.com/thnoed/damnclick/blob/main/Core/SoundBank.cs): `Core/SoundBank.cs`

### Profiles and settings

- [Profile models](https://github.com/thnoed/damnclick/blob/main/Core/Models.cs): `Core/Models.cs`
- [Profile storage](https://github.com/thnoed/damnclick/blob/main/Core/ProfileStore.cs): `Core/ProfileStore.cs`

### Other components

- **User**
- **Windows input APIs**
- **Game or foreground app**
- **profiles.dat**

## Connections

- User → Main window: configures (evidence: `README.md`)
- Main window → Profile storage: loads and saves (evidence: `MainWindow.xaml.cs`)
- Profile storage → profiles.dat: reads and writes (evidence: `README.md`)
- Profile storage → Profile models: serializes (evidence: `Core/ProfileStore.cs`)
- Main window → Bind editor: creates (evidence: `MainWindow.xaml.cs`)
- Bind editor → Click runner: refreshes (evidence: `BlockCard.xaml.cs`)
- Bind editor → Localization: gets labels (evidence: `BlockCard.xaml.cs`)
- Main window → Localization: gets labels (evidence: `MainWindow.xaml.cs`)
- Main window → Click runner: creates (evidence: `MainWindow.xaml.cs`)
- Main window → Global input hook: starts (evidence: `MainWindow.xaml.cs`)
- Global input hook → Click runner: sends key events (evidence: `Core/BlockRunner.cs`)
- Global input hook → Key encoding: encodes input (evidence: `Core/GlobalHook.cs`)
- Click runner → Key state: checks held key (evidence: `Core/BlockRunner.cs`)
- Key state → Key encoding: converts key (evidence: `Core/KeyState.cs`)
- Key state → Input and timing API: checks physical state (evidence: `Core/KeyState.cs`)
- Click runner → Input and timing API: injects timed clicks (evidence: `Core/BlockRunner.cs`)
- Input and timing API → Windows input APIs: calls input APIs (evidence: `Core/Win32.cs`)
- Windows input APIs → Game or foreground app: delivers clicks
- Main window → Toggle sounds: uses toggle sounds (evidence: `MainWindow.xaml.cs`)
