Crates.io | logitech-cve |
lib.rs | logitech-cve |
version | 1.5.3 |
created_at | 2025-07-30 13:45:47.806731+00 |
updated_at | 2025-09-09 16:08:43.975974+00 |
description | A Rust library for interacting with Logitech virtual driver. |
homepage | https://github.com/BatogiX/logitech-cve |
repository | https://github.com/BatogiX/logitech-cve |
max_upload_size | |
id | 1773555 |
size | 64,130 |
A Rust library for interacting with Logitech virtual driver.
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
}
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");
}