12 stable releases
Uses new Rust 2024
| 1.5.3 | Sep 9, 2025 |
|---|---|
| 1.5.1 | Aug 25, 2025 |
| 1.1.0 | Jul 30, 2025 |
#153 in Windows APIs
739 downloads per month
37KB
645 lines
logitech-cve
A Rust library for interacting with Logitech virtual driver.
Usage
Mouse
Example
use logitech_cve::{
device::Device,
mouse::{Mouse, MouseButton}
};
fn main() {
let device = Device::try_new().expect("Logitech G HUB 2021.11.1775 is not installed"); // Req for Driver Handling
let mouse = Mouse::new(&device); // Init Mouse
mouse.move_relative(MouseButtons::Release, 100, 100); // (x,y) relative
mouse.move_absolute(MouseButtons::Left, 100, 100, 30); // (x,y) absolute and 30ms between each step
mouse.wheel(1); // Scroll up
mouse.wheel(-1); // Scroll down
mouse.click(MouseButtons::Left, 120); // Press and sleeps for 120ms before release
// OR
mouse.press(MouseButtons::Left); // Press
std::thread::sleep(std::time::Duration(100)); // Custom sleep
mouse.release(); // Release
}
Keyboard
Example
use logitech_cve::{
device::Device,
keyboard::{Keyboard, Key}
};
fn main() {
let device = Device::try_new().expect("Logitech G HUB 2021.11.1775 is not installed"); // Req for Driver Handling
let keyboard = Keyboard::new(&device); // Init Keyboard
keyboard.press_and_release(Key::A, 120); // Press and sleeps for 120ms before release
// Press multiple buttons
keyboard.multi_press(Key::A, Key::B, Key::C, Key::Release, Key::Release, Key::Release);
std::thread::sleep(std::time::Duration(100)); // Custom sleep
keyboard.release(); // Release all buttons
// Types "Hello, World!" with 50ms before release each button
keyboard.type_string("Hello, World!", 50).expect("Should be OK");
}
Requirements
- Logitech G HUB 2021.11.1775
Credits
Dependencies
~17–25MB
~326K SLoC