uinput-ioctls 0.1.0

Rust bindings for Linux uinput ioctl constants and helper macros.
Documentation
  • Coverage
  • 0%
    0 out of 43 items documented0 out of 21 items with examples
  • Size
  • Source code size: 8.3 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 185.2 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 7s Average build duration of successful builds.
  • all releases: 7s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • joleuger/vuinputd
    36 2 7
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • joleuger

uinput-ioctls

uinput-ioctls provides Rust bindings and constants for the Linux uinput subsystem's ioctl interface.

It exposes ioctl_* helper functions and constants based on the Linux kernel's uinput.h, allowing you to interact with virtual input devices (keyboards, mice, gamepads, etc.) through Rust in a low-level but type-safe way.

This crate does not attempt to abstract or validate ioctl usage; it only provides constants and wrappers. Higher-level logic (such as event management or device configuration) should be built on top.


✨ Features

  • Idiomatic Rust wrappers around uinput ioctl definitions.
  • Uses the nix crate for safe ioctl macros.
  • Includes all UI_* constants and corresponding helper functions:
    • ui_dev_create, ui_dev_destroy
    • ui_dev_setup, ui_abs_setup
    • ui_set_evbit, ui_set_keybit, ...
    • ui_begin_ff_upload, ui_end_ff_upload, etc.

🧰 Example

Mouse example

Keyboard example

⚠️ Requires Linux and appropriate permissions to access /dev/uinput.


🧩 Related Crates

  • uinput: High-level abstraction for creating virtual input devices.
  • nix: Provides low-level Unix system call wrappers and ioctl macros.

📜 License

Licensed under the MIT License.


👤 Author

Johannes Leupolz dev@leupolz.eu