Crates.io | logitech-lcd |
lib.rs | logitech-lcd |
version | 2.0.0 |
source | src |
created_at | 2017-06-20 19:38:46.149642 |
updated_at | 2018-05-24 13:05:26.616271 |
description | Rust bindings for the Logitech Gaming LCD/Gamepanel SDK. |
homepage | https://github.com/henninglive/logitech-lcd |
repository | https://github.com/henninglive/logitech-lcd |
max_upload_size | |
id | 19797 |
size | 55,368 |
Rust bindings for the Logitech Gaming LCD/Gamepanel SDK
The Logitech LCD/GamePanel SDK introduces second screen capability that allows GamePanel-enabled Logitech gaming keyboards to display in-game info, system statistics, and more. The SDK enables integration of GamePanel functionality within your code.
The Logitech Gaming Software comes with an LCD emulator. You can access it by going to your task bar tray CTRL + SHIFT + RIGHT CLICK
on Logitech Gaming Software tray icon and press "LCD Emulator"
This crate will try to locate and load LogitechLcd.dll
at runtime. We start by looking up the CLSID
in the Windows registry, if it’s found we load the library with a call to LoadLibrary()
with the full path. If it fails we call LoadLibrary()
with just the DLL name. This will search your PATH
for the library.
extern crate logitech_lcd;
use logitech_lcd::Lcd;
fn main() {
let mut lcd = logitech_lcd::Lcd::init_mono("Hello World").unwrap();
lcd.set_mono_text(1, " Hello World!").unwrap();
lcd.update();
std::thread::sleep(std::time::Duration::from_millis(5000));
}
extern crate logitech_lcd;
use logitech_lcd::{Lcd, COLOR_WIDTH, COLOR_HEIGHT, COLOR_BYTES_PER_PIXEL};
fn main() {
let blank_screen = std::iter::repeat(255u8).take(
COLOR_WIDTH * COLOR_HEIGHT * COLOR_BYTES_PER_PIXEL).collect::<Vec<u8>>();
let mut lcd = Lcd::init_color("Color image app").unwrap();
lcd.set_color_background(&blank_screen[..]).unwrap();
lcd.set_color_title(" Hello World!", 0, 0, 0).unwrap();
lcd.set_color_text(0, "Red", 0xFF, 0x00, 0x00).unwrap();
lcd.set_color_text(1, "Green", 0x00, 0xFF, 0x00).unwrap();
lcd.set_color_text(2, "Blue", 0x00, 0x00, 0xFF).unwrap();
lcd.set_color_text(3, "Yellow", 0xFF, 0xFF, 0x00).unwrap();
lcd.set_color_text(4, "Cyan ", 0x00, 0xFF, 0xFF).unwrap();
lcd.set_color_text(5, "Magenta", 0xFF, 0x00, 0xFF).unwrap();
lcd.update();
std::thread::sleep(std::time::Duration::from_millis(10000));
}
The artifacts should only be visible in the emulator.
Licensed under either of
The Rust and Cargo logos (bitmap and vector) are owned by Mozilla and distributed under the terms of the Creative Commons Attribution license (CC-BY)
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions.