Crates.io | app_input |
lib.rs | app_input |
version | 0.1.2 |
created_at | 2024-12-22 22:08:53.506678+00 |
updated_at | 2025-06-09 08:00:30.721405+00 |
description | Cross-platform mouse and keyboard input |
homepage | https://sealedabstract.com/code/app_input |
repository | https://github.com/drewcrawford/app_input |
max_upload_size | |
id | 1492313 |
size | 314,736 |
app_input is a cross-platform library for receiving keyboard and mouse events.
Report raw up/down events whenever possible
Keycodes are translated into a platform-independent enum that works everywhere
On Linux, key events are broadcasted over ATSPI. Due to some questionable decisions in the Linux ecosystem this is required for screenreaders to work but nobody does it. We do!
Platform | Backend |
---|---|
Windows | win32* |
macOS | AppKit |
Linux | Wayland* |
wasm32 | KeyboardEvent | MouseEvent |
Yours | Send a PR! |
*
: Needs platform-native event integration before events are delivered. Consider using app_window!This library is also available as an npm package for JavaScript/TypeScript projects targeting WebAssembly. The package provides type definitions and can be used in web applications.
The library provides debug window functions for testing keyboard input:
debug_window_show()
- Shows a debug window for testing keyboard input (macOS only)debug_window_hide()
- Hides the debug window (macOS only)These functions are useful for debugging keyboard event handling without interference from other applications.
Events include information about the window they were delivered to via the Window
struct: