# anjudeepveerla/shortgun-keyboard-by-vad- architecture

> Architecture diagram of the GitHub repository anjudeepveerla/shortgun-keyboard-by-vad-, 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/anjudeepveerla/shortgun-keyboard-by-vad-
- Repository: https://github.com/anjudeepveerla/shortgun-keyboard-by-vad-

## Overview

ShotgunKeyboard is a macOS and Windows desktop app that plays selected sound effects on key-down events. Users configure sounds, selection mode, volume, and armed state; the platform app monitors keyboard events, chooses a configured sound, and plays it. Both platforms also support importing sounds and local settings, while macOS uses a menu-bar item and Windows a notification-area tray. Platform behavior is consolidated in each app’s main source file; links reflect only relationships shown in the excerpts or README.

Main entry points: [`main.swift`](https://github.com/anjudeepveerla/shortgun-keyboard-by-vad-/blob/main/main.swift) (macOS app and controls), [`windows/Program.cs`](https://github.com/anjudeepveerla/shortgun-keyboard-by-vad-/blob/main/windows/Program.cs) (Windows app and controls), [`bundled-sounds`](https://github.com/anjudeepveerla/shortgun-keyboard-by-vad-/tree/main/bundled-sounds) (Bundled effects), [`generate_sound.py`](https://github.com/anjudeepveerla/shortgun-keyboard-by-vad-/blob/main/generate_sound.py) (Generated WAV effects)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mac["macOS app"]
  node_macapp["macOS app and controls<br/>[main.swift]"]
  node_macaudio["macOS audio playback<br/>[main.swift]"]
  node_macsettings[("macOS local settings<br/>[main.swift]")]
  node_macmonitor["macOS key monitoring<br/>[main.swift]"]
end

subgraph group_windows["Windows app"]
  node_winapp["Windows app and controls<br/>[Program.cs]"]
  node_winaudio["Windows audio engine<br/>[Program.cs]"]
  node_winsettings[("Windows local settings<br/>[Program.cs]")]
  node_winmonitor["Windows key hook<br/>[Program.cs]"]
end

subgraph group_assets["Sound assets"]
  node_bundled["Bundled effects"]
  node_generated["Generated WAV effects<br/>[generate_sound.py]"]
end

node_user(("Desktop user"))
node_macos{{"macOS"}}
node_windowsos{{"Windows"}}

node_user -->|"configures"| node_macapp
node_user -->|"configures"| node_winapp
node_macapp -->|"starts monitoring"| node_macmonitor
node_macmonitor -->|"reports key-down"| node_macapp
node_macapp -->|"plays selected"| node_macaudio
node_macapp -->|"loads and saves"| node_macsettings
node_macapp -->|"uses effects"| node_bundled
node_macapp -->|"includes generated effects"| node_generated
node_macos -->|"provides key events"| node_macmonitor
node_macapp -->|"requests permissions"| node_macos
node_user -->|"configures"| node_winapp
node_winapp -->|"creates hook"| node_winmonitor
node_winmonitor -->|"calls key-down"| node_winapp
node_winapp -.->|"plays selected"| node_winaudio
node_winapp -->|"loads and saves"| node_winsettings
node_winapp -->|"extracts effects"| node_bundled
node_winapp -->|"includes generated effects"| node_generated
node_windowsos -->|"provides key events"| node_winmonitor
node_user -->|"imports sounds"| node_macapp
node_user -->|"imports sounds"| node_winapp

click node_macapp "https://github.com/anjudeepveerla/shortgun-keyboard-by-vad-/blob/main/main.swift"
click node_macaudio "https://github.com/anjudeepveerla/shortgun-keyboard-by-vad-/blob/main/main.swift"
click node_macsettings "https://github.com/anjudeepveerla/shortgun-keyboard-by-vad-/blob/main/main.swift"
click node_macmonitor "https://github.com/anjudeepveerla/shortgun-keyboard-by-vad-/blob/main/main.swift"
click node_winapp "https://github.com/anjudeepveerla/shortgun-keyboard-by-vad-/blob/main/windows/Program.cs"
click node_winaudio "https://github.com/anjudeepveerla/shortgun-keyboard-by-vad-/blob/main/windows/Program.cs"
click node_winsettings "https://github.com/anjudeepveerla/shortgun-keyboard-by-vad-/blob/main/windows/Program.cs"
click node_winmonitor "https://github.com/anjudeepveerla/shortgun-keyboard-by-vad-/blob/main/windows/Program.cs"
click node_bundled "https://github.com/anjudeepveerla/shortgun-keyboard-by-vad-/tree/main/bundled-sounds"
click node_generated "https://github.com/anjudeepveerla/shortgun-keyboard-by-vad-/blob/main/generate_sound.py"

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_macapp,node_macaudio,node_macsettings,node_macmonitor,node_user toneBlue
class node_winapp,node_winaudio,node_winsettings,node_winmonitor toneAmber
class node_bundled,node_generated toneMint
class node_macos,node_windowsos toneIndigo
```

## Components

### macOS app

- [macOS app and controls](https://github.com/anjudeepveerla/shortgun-keyboard-by-vad-/blob/main/main.swift): `main.swift`
- [macOS audio playback](https://github.com/anjudeepveerla/shortgun-keyboard-by-vad-/blob/main/main.swift): `main.swift`
- [macOS local settings](https://github.com/anjudeepveerla/shortgun-keyboard-by-vad-/blob/main/main.swift): `main.swift`
- [macOS key monitoring](https://github.com/anjudeepveerla/shortgun-keyboard-by-vad-/blob/main/main.swift): `main.swift`

### Windows app

- [Windows app and controls](https://github.com/anjudeepveerla/shortgun-keyboard-by-vad-/blob/main/windows/Program.cs): `windows/Program.cs`
- [Windows audio engine](https://github.com/anjudeepveerla/shortgun-keyboard-by-vad-/blob/main/windows/Program.cs): `windows/Program.cs`
- [Windows local settings](https://github.com/anjudeepveerla/shortgun-keyboard-by-vad-/blob/main/windows/Program.cs): `windows/Program.cs`
- [Windows key hook](https://github.com/anjudeepveerla/shortgun-keyboard-by-vad-/blob/main/windows/Program.cs): `windows/Program.cs`

### Sound assets

- [Bundled effects](https://github.com/anjudeepveerla/shortgun-keyboard-by-vad-/tree/main/bundled-sounds): `bundled-sounds`
- [Generated WAV effects](https://github.com/anjudeepveerla/shortgun-keyboard-by-vad-/blob/main/generate_sound.py): `generate_sound.py`

### Other components

- **Desktop user**
- **macOS**
- **Windows**

## Connections

- Desktop user → macOS app and controls: configures (evidence: `README.md`)
- Desktop user → Windows app and controls: configures (evidence: `README.md`)
- macOS app and controls → macOS key monitoring: starts monitoring (evidence: `main.swift`)
- macOS key monitoring → macOS app and controls: reports key-down (evidence: `main.swift`)
- macOS app and controls → macOS audio playback: plays selected (evidence: `main.swift`)
- macOS app and controls → macOS local settings: loads and saves (evidence: `main.swift`)
- macOS app and controls → Bundled effects: uses effects (evidence: `README.md`)
- macOS app and controls → Generated WAV effects: includes generated effects (evidence: `README.md`)
- macOS → macOS key monitoring: provides key events (evidence: `README.md`)
- macOS app and controls → macOS: requests permissions (evidence: `README.md`)
- Desktop user → Windows app and controls: configures (evidence: `README.md`)
- Windows app and controls → Windows key hook: creates hook (evidence: `windows/Program.cs`)
- Windows key hook → Windows app and controls: calls key-down (evidence: `windows/Program.cs`)
- Windows app and controls → Windows audio engine: plays selected (evidence: `windows/Program.cs`)
- Windows app and controls → Windows local settings: loads and saves (evidence: `windows/Program.cs`)
- Windows app and controls → Bundled effects: extracts effects (evidence: `windows/Program.cs`)
- Windows app and controls → Generated WAV effects: includes generated effects (evidence: `README.md`)
- Windows → Windows key hook: provides key events (evidence: `windows/Program.cs`)
- Desktop user → macOS app and controls: imports sounds (evidence: `README.md`)
- Desktop user → Windows app and controls: imports sounds (evidence: `README.md`)
