Configuration is accomplished using the commands described in the [Commands] section.
Commands can be loaded from a file specified by the --config option on the command line.
Commands can be also be sent to the command input pipe, which is at ***/tmp/g13-0*** by
default. Example:
echo rgb 0 255 0 > /tmp/g13-0
### Actions
Various parts of configuring the G13 depend on assigning actions to occur based on something happening to the G13.
* key, possible values shown upon startup (e.g. ***KEY_LEFTSHIFT***).
* multiple keys, like ***KEY_LEFTSHIFT+KEY_F1***
* pipe output, by using ">" followed by text, as in ***>Hello*** - causing **Hello** (plus newline) to be written to the output pipe ( **/tmp/g13-0_out** by default )
* command, by using "!" followed by text, as in ***!stick_mode KEYS***
## Commands
### rgb *r* *g* *b*
Sets the backlight color
### mod *n*
Sets the background light of the mod-keys. *n* is the sum of 1 (M1), 2 (M2), 4 (M3) and 8 (MR) (i.e. 13
would set M1, M3 and MR, and unset M2).
### bind *keyname* *action*
This binds a key or a stick zone.
* The possible values of *keyname* for keys are shown upon startup (e.g. G1).
* The possible values of *action* are described in [Actions].
### stickmode *mode*
The stick can be used as an absolute input device or can send key events. You can change modes to one of the following:
Mode | Description
-----------|---------------------------
KEYS | translates stick movements into key / action bindings
ABSOLUTE | stick becomes mouse with absolute positioning
RELATIVE | not quite working yet...
CALCENTER | calibrate stick center position
CALBOUNDS | calibrate stick boundaries
CALNORTH | calibrate stick north
### stickzone *operation* *zonename* *args*
defines zones to be used when the stick is in KEYS mode
Where *operation* can be
operation | what it does
----------|----------------
add | add a new zone named *zonename*
del | remove zone named *zonename*
action | set action for zone, see [Actions]
bounds | set boundaries for zone, *args* are X1, Y1, X2, Y2, where X1/Y1 are top left corner, X2/Y2 are bottom right corner
Default created zones are LEFT, RIGHT, UP and DOWN.
Zone boundary coordinates are based on a floating point value from 0.0 (top/left) to 1.0 (bottom/right). When the
stick enters the boundary area, the zone's action ***down*** activity will be fired. On exiting the boundary, the
action ***up*** activity will be fired.
Example:
stickzone add TheBottomLeft
stickzone bounds TheBottomLeft 0.0 0.9 0.1 1.0
stickzone action KEY_END
### pos *row* *col*
Sets the current text position to *row**col*.
* *row* is specified in characters (0-4), as all fonts are 8 pixels high and rows start on pixel row 0, 8, 16, 24, or 32
* *col* is specified in pixels (0-159)
### out *text*
Writes *text* to the LCD at the current text position, and advances the current position based on the font size
### clear
Clears the LCD
### textmode *mode*
Sets the text mode to *mode*, current options are 0 (normal) or 1 (inverted)
### refresh
Resends the LCD buffer
### profile *profile_name*
Selects *profile_name* to be the current profile, it if it doesn't exist creating it as a copy of the current profile.
All key binding changes (from the bind command) are made on the current profile.
### font *font_name*
Switch font, current options are ***8x8*** and ***5x8***