Skip to main content

A Python wrapper for Linux /dev/uinput keystroke simulation

Project description

rs_uinput

rs_uinput is a Python library backed by Rust that types text through Linux's uinput subsystem.

Instead of injecting keystrokes into a specific application, it creates a virtual keyboard device and sends real keyboard events through the Linux input stack.

Example

import rs_uinput

rs_uinput.type_text(
    text="Hello, world!",
    min_delay=0.05,
    max_delay=0.15
)

How It Works

  1. Python calls the Rust extension through PyO3.
  2. Rust creates a virtual keyboard using /dev/uinput.
  3. Each character is converted into the corresponding Linux key code.
  4. Key press and key release events are sent through the kernel.
  5. A random delay is applied between characters.

How It Differs From pynput

pynput typically relies on higher-level desktop APIs (X11, Wayland compatibility layers, platform-specific event injection APIs, etc.).

rs_uinput operates at the Linux input-device layer by creating a virtual keyboard device.

pynput
  ↓
Desktop API
  ↓
Application

rs_uinput
  ↓
Virtual Keyboard Device
  ↓
Linux Input Subsystem
  ↓
Application

Because it acts as an input device, applications receive the events through the normal Linux input pipeline rather than through a specific GUI automation API.

How It Differs From Selenium

Selenium does not generate system-wide keyboard input.

Instead, Selenium controls a web browser through the browser's automation interface:

Selenium
  ↓
Browser Driver
  ↓
Browser

This means Selenium can only interact with browser content that it controls.

rs_uinput generates keyboard events at the operating-system level, allowing text to be entered into any focused application that accepts keyboard input.

Use Cases

  • Desktop automation
  • Automated testing
  • Kiosk systems
  • Accessibility tools
  • Input simulation on Linux

Requirements

  • Linux
  • Kernel uinput support
  • Access to /dev/uinput

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rs_uinput_kb-0.1.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rs_uinput_kb-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl (218.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

File details

Details for the file rs_uinput_kb-0.1.0.tar.gz.

File metadata

  • Download URL: rs_uinput_kb-0.1.0.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.13.3

File hashes

Hashes for rs_uinput_kb-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cf3b767d11d9e5a4f09247c5399728117c2e7acd3cfbb88406b51afd233235df
MD5 c29522c1173a75f561f32910bcb1e01c
BLAKE2b-256 c978a1cadf79748576a575adf76b01512e9661a96152eea67c9e2576974bb31e

See more details on using hashes here.

File details

Details for the file rs_uinput_kb-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for rs_uinput_kb-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 2b6db815c05766fe2f7d961825438f1e83e1883c46699c2e8da648a4ae4c6030
MD5 936b972dc62656b1a10a8e6ef7b27a83
BLAKE2b-256 f157b6fa2175572359639ff899df117c8e1046a165eded6d39f45edd719e9e08

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page