# jatinkrumkar/asusfnlock architecture

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

- Interactive diagram: https://gitdiagram.com/jatinkrumkar/asusfnlock
- Repository: https://github.com/jatinkrumkar/asusfnlock

## Overview

AsusFnlock is a Windows tray application that provides a software Fn-lock toggle for ASUS laptops without a hardware Fn-lock key. Its main workflow is to load the saved state, register keyboard hotkeys, and toggle the lock through a global shortcut or tray menu; it also persists changes and displays an on-screen indicator. The single sampled source file contains these responsibilities, so they are represented as distinct stages within that implementation. The excerpts do not show the complete hotkey dispatch or OSD trigger paths.

Main entry points: [`Program.cs`](https://github.com/jatinkrumkar/asusfnlock/blob/main/Program.cs) (Fn-lock app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Fn-lock runtime"]
  node_app["Fn-lock app<br/>[Program.cs]"]
  node_hotkeys["Hotkey handling<br/>[Program.cs]"]
  node_tray["Tray controls<br/>[Program.cs]"]
  node_osd["Status OSD<br/>[Program.cs]"]
end

subgraph group_windows["Windows integration"]
  node_state[("Saved lock state<br/>[Program.cs]")]
  node_acpi["ACPI control<br/>[Program.cs]"]
  node_brightness["Brightness controls<br/>[Program.cs]"]
  node_startup["Startup task<br/>[Program.cs]"]
end

node_user(("Laptop user"))
node_windows{{"Windows services"}}

node_app -->|"loads and saves"| node_state
node_app -->|"registers hotkeys"| node_hotkeys
node_user -.->|"presses shortcut"| node_hotkeys
node_user -->|"uses menu"| node_tray
node_tray -->|"toggles lock"| node_app
node_app -.->|"shows status"| node_osd
node_app -->|"sets device state"| node_acpi
node_app -->|"adjusts brightness"| node_brightness
node_tray -->|"toggles startup"| node_startup
node_hotkeys -->|"registers keys"| node_windows
node_acpi -->|"calls ACPI"| node_windows
node_brightness -->|"uses WMI"| node_windows
node_startup -->|"runs schtasks"| node_windows

click node_app "https://github.com/jatinkrumkar/asusfnlock/blob/main/Program.cs"
click node_state "https://github.com/jatinkrumkar/asusfnlock/blob/main/Program.cs"
click node_hotkeys "https://github.com/jatinkrumkar/asusfnlock/blob/main/Program.cs"
click node_tray "https://github.com/jatinkrumkar/asusfnlock/blob/main/Program.cs"
click node_osd "https://github.com/jatinkrumkar/asusfnlock/blob/main/Program.cs"
click node_acpi "https://github.com/jatinkrumkar/asusfnlock/blob/main/Program.cs"
click node_brightness "https://github.com/jatinkrumkar/asusfnlock/blob/main/Program.cs"
click node_startup "https://github.com/jatinkrumkar/asusfnlock/blob/main/Program.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_app,node_hotkeys,node_tray,node_osd,node_user toneBlue
class node_state,node_acpi,node_brightness,node_startup toneAmber
class node_windows toneIndigo
```

## Components

### Fn-lock runtime

- [Fn-lock app](https://github.com/jatinkrumkar/asusfnlock/blob/main/Program.cs): `Program.cs`
- [Hotkey handling](https://github.com/jatinkrumkar/asusfnlock/blob/main/Program.cs): `Program.cs`
- [Tray controls](https://github.com/jatinkrumkar/asusfnlock/blob/main/Program.cs): `Program.cs`
- [Status OSD](https://github.com/jatinkrumkar/asusfnlock/blob/main/Program.cs): `Program.cs`

### Windows integration

- [Saved lock state](https://github.com/jatinkrumkar/asusfnlock/blob/main/Program.cs): `Program.cs`
- [ACPI control](https://github.com/jatinkrumkar/asusfnlock/blob/main/Program.cs): `Program.cs`
- [Brightness controls](https://github.com/jatinkrumkar/asusfnlock/blob/main/Program.cs): `Program.cs`
- [Startup task](https://github.com/jatinkrumkar/asusfnlock/blob/main/Program.cs): `Program.cs`

### Other components

- **Laptop user**
- **Windows services**

## Connections

- Fn-lock app → Saved lock state: loads and saves (evidence: `Program.cs`)
- Fn-lock app → Hotkey handling: registers hotkeys (evidence: `Program.cs`)
- Laptop user → Hotkey handling: presses shortcut
- Laptop user → Tray controls: uses menu (evidence: `Program.cs`)
- Tray controls → Fn-lock app: toggles lock (evidence: `Program.cs`)
- Fn-lock app → Status OSD: shows status (evidence: `Program.cs`)
- Fn-lock app → ACPI control: sets device state (evidence: `Program.cs`)
- Fn-lock app → Brightness controls: adjusts brightness (evidence: `Program.cs`)
- Tray controls → Startup task: toggles startup (evidence: `Program.cs`)
- Hotkey handling → Windows services: registers keys (evidence: `Program.cs`)
- ACPI control → Windows services: calls ACPI (evidence: `Program.cs`)
- Brightness controls → Windows services: uses WMI (evidence: `Program.cs`)
- Startup task → Windows services: runs schtasks (evidence: `Program.cs`)
