back to home

debugtheworldbot / keyStats

Keyboard & Mouse Stats for macOS/Windows

889 stars
38 forks
4 issues
SwiftC#PowerShell

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing debugtheworldbot/keyStats in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Source files are only loaded when you start an analysis to optimize performance.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind.in/repo/debugtheworldbot/keyStats)
Preview:Analyzed by RepoMind

Repository Overview (README excerpt)

Crawler view

English | 简体中文 KeyStats - macOS/Windows Keyboard & Mouse Statistics Menu Bar App KeyStats is a lightweight native menu bar application for macOS and Windows that tracks daily keyboard keystrokes, mouse clicks, mouse movement distance, and scroll distance. Installation & Usage macOS Option 1: Install via Homebrew Update the app: Option 2: Download from GitHub Releases Windows Option 1: Install via Scoop Option 2: Download from GitHub Releases > **No dependencies required**: The Windows version uses .NET Framework 4.8, which is pre-installed on Windows 10 (1903+) and Windows 11 - ready to use out of the box. If your Windows 10 version is older (before 1903), you can upgrade your system or manually install .NET Framework 4.8. Features • **Keyboard Keystroke Statistics**: Real-time tracking of daily key presses • **Mouse Click Statistics**: Separate tracking of left and right clicks • **Mouse Movement Distance**: Track total distance of mouse movement • **Scroll Distance Statistics**: Record cumulative page scroll distance • **Menu Bar Display**: Core data displayed directly in macOS menu bar • **Detailed Panel**: Click menu bar icon to view complete statistics • **Daily Auto-Reset**: Statistics automatically reset at midnight • **Data Persistence**: Data persists after application restart System Requirements macOS • macOS 13.0 (Ventura) or higher Windows • **Windows 10 (1903+) or Windows 11** • **No dependencies required**: Uses .NET Framework 4.8 (pre-installed on Windows 10/11, ready to use out of the box) • **App size**: ~5-10 MB (lightweight, no additional runtime needed) > **Note**: If your Windows 10 version is older (before 1903), you can: > 1. Upgrade to Windows 10 1903 or higher (recommended) > 2. Or manually install .NET Framework 4.8: Download link First Run Permission Setup macOS KeyStats requires **Accessibility permissions** to monitor keyboard and mouse events. On first run: • The app will prompt a permission request dialog • Click "Open System Settings" • Find KeyStats in "Privacy & Security" > "Accessibility" • Enable the permission toggle for KeyStats • Once authorized, the app will automatically start tracking > **Note**: Without granting permissions, the app will not be able to track any data. > > **Reinstall/upgrade tip**: Because the app is not signed, macOS will not automatically update Accessibility authorization after each reinstall. Remove the existing KeyStats entry in "Privacy & Security" > "Accessibility", then return to the app and click the "Get Permission" button to request access again. > > **Auto-update tip (unsigned builds, macOS Ventura+)**: The first Sparkle update may fail. Enable KeyStats in "Privacy & Security" > "App Management" first. If it already failed, click the system authorization notification, turn on the toggle in Settings, and click "Update Now" again. Windows The Windows version **requires no additional permission setup**. The app will automatically start tracking once launched. > **Note**: On first launch, Windows may show a security warning. Click "Run anyway" to proceed. Usage Instructions Menu Bar Display Once the app is running, the menu bar will show: • The upper number represents total keyboard presses today • The lower number represents total mouse clicks today (including left and right buttons) Large numbers are automatically formatted: • 1,000+ displayed as • 1,000,000+ displayed as Detailed Panel Clicking the menu bar icon opens the detailed statistics panel, showing: | Statistic | Description | |-----------|-------------| | Keyboard Strokes | Total key presses today | | Left Clicks | Mouse left button clicks | | Right Clicks | Mouse right button clicks | | Mouse Movement | Total distance of mouse movement | | Scroll Distance | Cumulative page scroll distance | Action Buttons • **Reset Statistics**: Manually clear all statistics for today • **Quit Application**: Close KeyStats Import & Export (Multi-device Sync) You can sync statistics across devices using JSON export/import. • On device A, open Settings, click , and save the file. • On device B, open Settings, click , and choose that file. • Choose import mode: • : Replace local statistics with imported data. • : Merge imported data with local data and add totals by date. • To combine both devices into B: export from A, then import on B with . • Then export again from B, go back to A, and import with to make A and B consistent. Tips: • Export local data first as a backup before using overwrite. • Importing the same file with merge multiple times will add duplicate totals. Project Structure macOS Windows Technical Implementation macOS • **Language**: Swift 5.0 • **Frameworks**: AppKit, CoreGraphics • **Event Monitoring**: Global event listener using • **Data Storage**: Local persistence using • **UI Mode**: Pure menu bar application (LSUIElement = true) Windows • **Language**: C# 10 • **Framework**: WPF (.NET Framework 4.8) • **Architecture**: MVVM (Model-View-ViewModel) • **Event Monitoring**: Windows low-level keyboard/mouse hooks (SetWindowsHookEx) • **Data Storage**: Local persistence using JSON files • **UI Mode**: System tray application • **Advantages**: No runtime installation required, ready to use on Windows 10/11 out of the box, small app size (5-10 MB) Testing (AppStats) To make regression-testable, the repository includes XCTest-based tests in , executed with . Covered test cases: • Default initialization values. • Counter accumulation for key/click recording methods. • Absolute-value behavior of . • Empty-name guard in . • Normal display name update. • Codable round-trip consistency. • Legacy compatibility fallback. • New side-click fields taking precedence over legacy field. • Missing-field decode fallback to defaults. Run: Privacy Statement KeyStats only tracks the **count** of keystrokes and clicks, and **does NOT record**: • Which specific keys were pressed • Text content that was typed • Specific click locations or…