# mystigan/keylogger architecture

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

- Interactive diagram: https://gitdiagram.com/mystigan/keylogger
- Repository: https://github.com/mystigan/keylogger

## Overview

This small Go program captures terminal keystrokes, writes each rune to `test.txt`, and displays the pressed key. Pressing Escape ends the loop; deferred cleanup closes the keyboard and file. The source confirms terminal capture and file output, but does not establish global capture or any of the README’s proposed future features.

Main entry points: [`keyLogger.go`](https://github.com/mystigan/keylogger/blob/master/keyLogger.go) (Key logger)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime"]
  node_program["Key logger<br/>[keyLogger.go]"]
end

node_user(("User"))
node_keyboard["Keyboard library"]
node_output["Terminal output"]
node_logfile["test.txt"]

node_user -->|"presses keys"| node_keyboard
node_program -->|"opens and reads"| node_keyboard
node_keyboard -->|"sends events"| node_program
node_program -->|"writes runes"| node_logfile
node_program -->|"prints status"| node_output

click node_program "https://github.com/mystigan/keylogger/blob/master/keyLogger.go"

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_program,node_user toneBlue
class node_keyboard,node_output,node_logfile toneIndigo
```

## Components

### Runtime

- [Key logger](https://github.com/mystigan/keylogger/blob/master/keyLogger.go): `keyLogger.go`

### Other components

- **User**
- **Keyboard library**
- **Terminal output**
- **test.txt**

## Connections

- User → Keyboard library: presses keys
- Key logger → Keyboard library: opens and reads
- Keyboard library → Key logger: sends events
- Key logger → test.txt: writes runes
- Key logger → Terminal output: prints status
