Giter Club home page Giter Club logo

logitech-lcd's Introduction

logitech-lcd

Build status crates.io docs.rs

Rust bindings for the Logitech Gaming LCD/Gamepanel SDK

Overview

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.

Documentation

Supported Devices

  • G19 - 320x240 Full RGBA (Untested)
  • G510 - 160x43 Monochrome (Working)
  • G13 - 160x43 Monochrome (Untested)
  • G15 v1 - 160x43 Monochrome (Untested)
  • G15 v2 - 160x43 Monochrome (Untested)
  • LCD emulator - 160x43 Monochrome (Working)
  • LCD emulator - 320x240 Full RGBA (Working)

LCD Emulator

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"

Requirements

Dynamic Loading

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.

Examples

Hello World Monochrome

extern crate logitech_lcd;

fn main() {
    let mut driver = logitech_lcd::Driver::init_mono("Hello World").unwrap();

    driver.set_mono_text(1, "        Hello World!").unwrap();
    driver.update();

    std::thread::sleep(std::time::Duration::from_millis(5000));
}

hello-world-mono

Hello World Color

extern crate logitech_lcd;
use logitech_lcd::{Driver, 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 driver = Driver::init_color("Color image app").unwrap();
    driver.set_color_background(&blank_screen[..]).unwrap();

    driver.set_color_title("  Hello World!", 0, 0, 0).unwrap();

    driver.set_color_text(0, "Red",     0xFF, 0x00, 0x00).unwrap();
    driver.set_color_text(1, "Green",   0x00, 0xFF, 0x00).unwrap();
    driver.set_color_text(2, "Blue",    0x00, 0x00, 0xFF).unwrap();
    driver.set_color_text(3, "Yellow",  0xFF, 0xFF, 0x00).unwrap();
    driver.set_color_text(4, "Cyan ",   0x00, 0xFF, 0xFF).unwrap();
    driver.set_color_text(5, "Magenta", 0xFF, 0x00, 0xFF).unwrap();
    driver.update();

    std::thread::sleep(std::time::Duration::from_millis(10000));
}

hello-world-color

The artifacts should only be visible in the emulator.

Monochrome Image

/examples/mono-image.rs

image-mono

Color Image

/examples/color-image.rs

image-color

License

Code

Licensed under either of

Art

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)

Contribution

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.

logitech-lcd's People

Contributors

henninglive avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

logitech-lcd's Issues

Find and Load dll manually with LoadLibrary at Runtime

We currently let rust load DLLs for us, we should probably do it ourselves so we can do a lookup by CLSID in the windows registry at runtime like our build script does. This should fix problems that caused by Logitech not adding their DLLs to PATH.

Support static linking

We have .lib files for the msvc toolchain, we should add support linking them statically.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.