Crate g11_macro_keys

Source
Expand description

§g11-macro-keys

Library that models the USB/HID interface for the Logitech G11 Keyboard’s macro keys.

This was primarily written for use within g11-macro-daemon, but you may check out the examples to see how you could build your own weird stuff on top of this library.

§Key Layout

The macro keys interface covers:

  • 18 ‘G’ keys
  • 3 ‘M’ keys - each has its own LED
  • 1 ‘MR’ key - has its own LED
  • 1 Backlight key
  (M1) (M2) (M3)  (MR)   ...   (💡)

 ┌───┐┌───┐┌───┐
 │G1 ││G2 ││G3 │
 └───┘└───┘└───┘
 ┌───┐┌───┐┌───┐
 │G4 ││G5 ││G6 │
 └───┘└───┘└───┘

 ┌───┐┌───┐┌───┐
 │G7 ││G8 ││G9 │
 └───┘└───┘└───┘
 ┌───┐┌───┐┌───┐
 │G10││G11││G12│
 └───┘└───┘└───┘

 ┌───┐┌───┐┌───┐
 │G13││G14││G15│
 └───┘└───┘└───┘
 ┌───┐┌───┐┌───┐
 │G16││G17││G18│
 └───┘└───┘└───┘

Modules§

usb_id
Constants for locating the right USB device

Structs§

Event
Signal from the G11 that the user has performed an Action on a Key
State
Keeps track of the known device state, so that an individual Event may be isolated from each set of new bytes received over USB.

Enums§

Action
Whether the user has been observed to have Pressed or Released a Key
EventError
Errors that may arise during State::try_consume_event
Key
A specific key on the G11