Chapter 7. Ryos TKL

Table of Contents

Eventhandler configuration options
Lua scripting of ripple effects

Eventhandler configuration options

Some aspects of the eventhandler can be configured via a text configuration file stored in $HOME/.config/roccat/ryostkl.ini. The keys have to reside in section [Eventhandler].

Changes to these values require a restart of roccateventhandler to take place.

The supported keys are as follows.

UseLua

Uses Lua scripting engine if available. If value is false or Lua is not available a C implementation of the features will be used.

Valid values: true, false

Default value: false

Supported since roccat-tools version 3.1.0

RippleModule

Determines which Lua module to use if Lua is used. The ripple modules are normally stored in /usr/share/roccat/ryostkl_ripple_modules.

Valid values: any

Default value: ripple.lc

Supported since roccat-tools version 3.1.0

Lua scripting of ripple effects

A ripple module has to define 2 global functions.

start(hid)

Whenever a key is pressed, function start() gets called with the corresponding hid-usage-id as first argument. Returns nothing.

tick()

Function tick() is called repeatedly. It should return the waiting time until the next tick in milliseconds or nil if effect is finished. Changes made in the led matrix are written to the device after this function returns.

The eventhandler defines the table ryosmk with following fields that can be called from client code.

ryosmk.set_key(hids)

Sets the LEDs of the given keys to on. Takes a single integer hid-usage-id or a table with integer hid-usage-ids as keys.

ryosmk.clear_key(hids)

Sets the LEDs of the given keys to off. Takes a single integer hid-usage-id or a table with integer hid-usage-ids as keys.

ryosmk.get_key(hid)

Reads the status of a single key with the given hid-usage-id. Returns boolean true if LED is on, else false.

ryosmk.clear()

Switches all LEDs off.

ryosmk.empty()

Returns boolean true if all LEDs are off, else false.