Skip to content

A system-wide autocomplete and spell-checking utility for Windows written in Zig.

License

Notifications You must be signed in to change notification settings

PeterM45/SysInput

Repository files navigation

SysInput

SysInput is a lightweight Windows utility written in Zig. It provides system-wide autocomplete and spell checking across all applications by capturing keystrokes and displaying suggestions near your cursor.

Demo

SysInput Demo

Features

  • System-wide suggestions: Works in any standard text field.
  • Intelligent autocomplete: Learns from your typing.
  • Low resource usage: Efficiently built in Zig ⚡
  • Adaptive learning: Optimizes insertion methods per application

Installation

Prerequisites

Building from Source

git clone https://github.com/PeterM45/SysInput.git
cd SysInput
zig build
zig build run

The application runs in the background. Type in any text field and press Tab to see suggestions.

Usage

  1. Start typing in any text field (at least 2 characters).
  2. Suggestions appear near your cursor.
  3. Press Tab or Enter to accept a suggestion.
  4. Use Up/Down arrows to navigate suggestions.

Keyboard Shortcuts

Key Action
Tab Accept suggestion
Enter Accept suggestion
↓ Arrow Next suggestion
↑ Arrow Previous suggestion
Esc Exit SysInput

Architecture

  • Core: Text buffer, configuration, and debugging.
  • Input: Keyboard hooks and text field detection.
  • Text: Autocomplete engine, dictionary management, and spell checking.
  • UI: Suggestion overlay and window management.
  • Win32: Windows API bindings and hook implementations.

Project Structure

SysInput/
├── build.zig             - Build configuration
├── resources/
│   └── dictionary.txt    - Word dictionary for suggestions
└── src/
    ├── buffer_controller.zig - Text buffer management
    ├── core/               - Core functionality
    │   ├── buffer.zig      - Text buffer implementation
    │   ├── config.zig      - Configuration
    │   └── debug.zig       - Debugging utilities
    ├── input/             - Input handling
    │   ├── keyboard.zig    - Keyboard hook and processing
    │   ├── text_field.zig  - Text field detection
    │   └── window_detection.zig  - Window detection
    ├── main.zig           - Application entry point
    ├── module_exports.zig    - Main module imports
    ├── suggestion/        - Suggestion handling
    │   ├── manager.zig     - Suggestion manager
    │   └── stats.zig       - Statistics tracking
    ├── text/              - Text processing
    │   ├── autocomplete.zig - Autocomplete engine
    │   ├── dictionary.zig   - Dictionary loading/management
    │   ├── edit_distance.zig - Text similarity algorithms
    │   ├── insertion.zig     - Text insertion methods
    │   └── spellcheck.zig    - Spell checking
    ├── ui/                - User interface
    │   ├── position.zig    - UI positioning logic
    │   ├── suggestion_ui.zig - Suggestion UI
    │   └── window.zig      - Window management
    └── win32/             - Windows API bindings
        ├── api.zig         - Windows API definitions
        ├── hook.zig        - Hook implementation
        └── text_inject.zig - Text injection utilities

Contributing

Contributions are welcome! To get started:

  1. Fork the repository.
  2. Clone your fork.
  3. Create a branch for your changes.
  4. Submit a pull request.

Check out our contribution guidelines for more details.

Troubleshooting

No suggestions?

  • Ensure SysInput is running.
  • Type in a standard text field (minimum 2 characters).

Text insertion issues?

  • Try a different insertion method; some applications may have restrictions.

License

This project is licensed under the MIT License – see the LICENSE file for details.


Feel free to tweak as needed. Happy coding! 👍