# konkitoman/autoclicker architecture

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

- Interactive diagram: https://gitdiagram.com/konkitoman/autoclicker
- Repository: https://github.com/konkitoman/autoclicker

## Overview

TheClicker is a Linux CLI autoclicker supporting evdev input and uinput output, including normal and legacy modes. The user starts the CLI, selects or identifies an input device, configures bindings and timing, then presses a binding to generate clicks. The graph includes device selection, event handling and click generation, plus the internal input/output device layer. Some setup and timing logic is in omitted portions of src/lib.rs, so only documented or excerpt-supported relationships are connected.

Main entry points: [`src/lib.rs`](https://github.com/konkitoman/autoclicker/blob/main/src/lib.rs) (Input event monitor), [`src/main.rs`](https://github.com/konkitoman/autoclicker/blob/main/src/main.rs) (CLI entry), [`src/device.rs`](https://github.com/konkitoman/autoclicker/blob/main/src/device.rs) (Uinput output), [`src/args.rs`](https://github.com/konkitoman/autoclicker/blob/main/src/args.rs) (CLI arguments)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli_setup["CLI and setup"]
  node_entry["CLI entry<br/>[main.rs]"]
  node_arguments["CLI arguments<br/>[args.rs]"]
  node_setup["Mode and setup<br/>[lib.rs]"]
  node_selection["Device selection<br/>[device.rs]"]
end

subgraph group_click_runtime["Click runtime"]
  node_runtime["Runtime dispatch<br/>[lib.rs]"]
  node_event_monitor["Input event monitor<br/>[lib.rs]"]
  node_binding_state["Binding state<br/>[lib.rs]"]
  node_click_timing["Click timing<br/>[lib.rs]"]
end

subgraph group_device_io["Device I/O"]
  node_input_device["Evdev input<br/>[device.rs]"]
  node_output_device["Uinput output<br/>[device.rs]"]
end

node_user(("CLI user"))
node_system_input["Linux input devices"]
node_system_output["Linux input subsystem"]

node_user -->|"starts"| node_entry
node_entry -->|"parses"| node_arguments
node_entry -->|"initializes"| node_setup
node_user -->|"chooses device"| node_selection
node_setup -->|"selects or resolves"| node_selection
node_setup -->|"configures mode"| node_runtime
node_runtime -->|"runs"| node_event_monitor
node_event_monitor -->|"reads events"| node_input_device
node_input_device -->|"reads evdev"| node_system_input
node_event_monitor -->|"updates"| node_binding_state
node_binding_state -.->|"triggers"| node_click_timing
node_click_timing -->|"sends clicks"| node_output_device
node_output_device -->|"emits uinput events"| node_system_output
node_event_monitor -->|"forwards events"| node_output_device

click node_entry "https://github.com/konkitoman/autoclicker/blob/main/src/main.rs"
click node_arguments "https://github.com/konkitoman/autoclicker/blob/main/src/args.rs"
click node_setup "https://github.com/konkitoman/autoclicker/blob/main/src/lib.rs"
click node_selection "https://github.com/konkitoman/autoclicker/blob/main/src/device.rs"
click node_runtime "https://github.com/konkitoman/autoclicker/blob/main/src/lib.rs"
click node_event_monitor "https://github.com/konkitoman/autoclicker/blob/main/src/lib.rs"
click node_binding_state "https://github.com/konkitoman/autoclicker/blob/main/src/lib.rs"
click node_click_timing "https://github.com/konkitoman/autoclicker/blob/main/src/lib.rs"
click node_input_device "https://github.com/konkitoman/autoclicker/blob/main/src/device.rs"
click node_output_device "https://github.com/konkitoman/autoclicker/blob/main/src/device.rs"

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_entry,node_arguments,node_setup,node_selection,node_user toneBlue
class node_runtime,node_event_monitor,node_binding_state,node_click_timing toneAmber
class node_input_device,node_output_device toneMint
class node_system_input,node_system_output toneIndigo
```

## Components

### CLI and setup

- [CLI entry](https://github.com/konkitoman/autoclicker/blob/main/src/main.rs): `src/main.rs`
- [CLI arguments](https://github.com/konkitoman/autoclicker/blob/main/src/args.rs): `src/args.rs`
- [Mode and setup](https://github.com/konkitoman/autoclicker/blob/main/src/lib.rs): `src/lib.rs`
- [Device selection](https://github.com/konkitoman/autoclicker/blob/main/src/device.rs): `src/device.rs`

### Click runtime

- [Runtime dispatch](https://github.com/konkitoman/autoclicker/blob/main/src/lib.rs): `src/lib.rs`
- [Input event monitor](https://github.com/konkitoman/autoclicker/blob/main/src/lib.rs): `src/lib.rs`
- [Binding state](https://github.com/konkitoman/autoclicker/blob/main/src/lib.rs): `src/lib.rs`
- [Click timing](https://github.com/konkitoman/autoclicker/blob/main/src/lib.rs): `src/lib.rs`

### Device I/O

- [Evdev input](https://github.com/konkitoman/autoclicker/blob/main/src/device.rs): `src/device.rs`
- [Uinput output](https://github.com/konkitoman/autoclicker/blob/main/src/device.rs): `src/device.rs`

### Other components

- **CLI user**
- **Linux input devices**
- **Linux input subsystem**

## Connections

- CLI user → CLI entry: starts (evidence: `README.md`)
- CLI entry → CLI arguments: parses (evidence: `src/main.rs`)
- CLI entry → Mode and setup: initializes (evidence: `src/main.rs`)
- CLI user → Device selection: chooses device (evidence: `README.md`)
- Mode and setup → Device selection: selects or resolves (evidence: `src/lib.rs`)
- Mode and setup → Runtime dispatch: configures mode (evidence: `src/lib.rs`)
- Runtime dispatch → Input event monitor: runs (evidence: `src/lib.rs`)
- Input event monitor → Evdev input: reads events (evidence: `src/lib.rs`)
- Evdev input → Linux input devices: reads evdev (evidence: `src/device.rs`)
- Input event monitor → Binding state: updates (evidence: `src/lib.rs`)
- Binding state → Click timing: triggers (evidence: `src/lib.rs`)
- Click timing → Uinput output: sends clicks (evidence: `src/lib.rs`)
- Uinput output → Linux input subsystem: emits uinput events (evidence: `src/device.rs`)
- Input event monitor → Uinput output: forwards events (evidence: `src/lib.rs`)
