Version: 0.5.0
Docs.rs: ironrdp-input
Docs.rs: ironrdp-input
Overview
Theironrdp-input crate provides helpers to build RDP FastPath input events from high-level operations. It maintains input state (keys pressed, mouse buttons down) and generates correct event sequences, including:
- Suppressing duplicate events
- Synthesizing key release before re-press
- Handling extended scancodes
- Managing Unicode keyboard input
- Tracking mouse position and buttons
Core Types
Database
Database is the main entry point. It tracks input state and produces RDP events.
Operation
Scancode
MouseButton
MousePosition
WheelRotations
Usage Example
Basic Keyboard Input
Mouse Input
Unicode Input
State Deduplication
The database automatically suppresses no-op events:Releasing All Inputs
Lock Key Synchronization
State Types
KeyboardState: 512 bits (256 standard + 256 extended scancodes)MouseButtonsState: 5 bits (one per mouse button)
Advanced: Web Integration
Dependencies
ironrdp-pdu- PDU structures forFastPathInputEvent(public)bitvec- Efficient bit arrays for state trackingsmallvec- Stack-allocated vectors for events
Usage Notes
Event Ordering:
The database maintains correct event ordering. For example, if a key is already pressed and pressed again, the database synthesizes a release before the new press:
The database maintains correct event ordering. For example, if a key is already pressed and pressed again, the database synthesizes a release before the new press:
Extended Scancodes:
Extended scancodes (0xE0 prefix) are common for keys like arrows, right Ctrl/Alt, and navigation keys. Use
Extended scancodes (0xE0 prefix) are common for keys like arrows, right Ctrl/Alt, and navigation keys. Use
Scancode::from_u16() with the 0xE000 bit set:Mouse Coordinates:
RDP mouse coordinates are in the range
RDP mouse coordinates are in the range
[0, 65535] and are normalized to the desktop size. Scale physical pixels accordingly:See Also
- ironrdp-pdu - Input PDU structures
- ironrdp-session - Session management
- MS-RDPBCGR §2.2.8 - Input PDU specification

