# robertnisipeanu/winkeymacros architecture

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

- Interactive diagram: https://gitdiagram.com/robertnisipeanu/winkeymacros
- Repository: https://github.com/robertnisipeanu/winkeymacros

## Overview

##### Kernel-Level Driver (KeyboardFilterDriverKMDF)
- This is implemented as a KMDF (Kernel Mode Driver Framework) driver. It handles low-level tasks such as intercepting key inputs and injecting keys at the kernel level.
- Files related: Driver.cpp/h, MacroManager.cpp/h, UserCommunication.cpp/h, shared IOCTL definitions, and associated build files.
- It acts as the backbone: monitoring key inputs and differentiating between them based on source devices.

##### Communication Library (MacroLibrary)
- Provides an abstraction layer that simplifies interacting with the driver. Instead of handling low-level IOCTL requests, applications can use a higher-level API.
- Files: MacroLibrary.cpp/h, framework.h, and related Visual Studio project files.
- It encapsulates the communication protocol between an application and the kernel driver.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Application Layer"
        APP["Application – ConsoleCommunicationTest / Future UI App\n(Macro Management UI/Console)"]:::application
    end

    subgraph "Library Layer"
        ML["Communication Library – MacroLibrary\n(Driver Communication Abstraction)"]:::library
    end

    subgraph "Kernel Driver Layer"
        KD["Kernel Driver – KeyboardFilterDriverKMDF\n(Low-Level Key Interception)"]:::kernel
    end

    APP -->|"API_calls"| ML
    ML -->|"IOCTL_commands"| KD
    KD -->|"Key_injection_events"| ML

    click APP "https://github.com/robertnisipeanu/winkeymacros/tree/master/ConsoleCommunicationTest/"
    click ML "https://github.com/robertnisipeanu/winkeymacros/tree/master/MacroLibrary/"
    click KD "https://github.com/robertnisipeanu/winkeymacros/tree/master/KeyboardFilterDriverKMDF/"

    classDef kernel fill:#f87171,stroke:#000,stroke-width:2px,color:#fff;
    classDef library fill:#60a5fa,stroke:#000,stroke-width:2px,color:#fff;
    classDef application fill:#34d399,stroke:#000,stroke-width:2px,color:#fff;
```
