module GLed

Allows control of Logitech G LEDs. Call GLed.init before use.

Public Class Methods

init(installation_type = '64') click to toggle source

Initialises the library. The parameter should be the Ruby installation's bitness architecture, either 86 or 64.

# File lib/grgbrb.rb, line 7
def self.init(installation_type = '64')
  @lib = Fiddle.dlopen('C:\Program Files\Logitech Gaming Software\SDK\LED' \
                       "\\x#{installation_type}\\LogitechLed.dll")

  Fiddle::Function.new(@lib['LogiLedInit'], [], Fiddle::TYPE_VOID).call
end
set_color(red, green, blue) click to toggle source

Sets the RGB values of the mouse color. Each value is out of 100.

# File lib/grgbrb.rb, line 15
def self.set_color(red, green, blue)
  fiddle_fun = Fiddle::Function.new(
    @lib['LogiLedSetLighting'],
    [Fiddle::TYPE_INT] * 3,
    Fiddle::TYPE_VOID
  )

  fiddle_fun.call(red, green, blue)
end