Next: , Previous: , Up: Tutorial   [Contents][Index]

2.2.4 Example Configuration: Remap Events

Next, we see the option called #:remap-events:

 #:remap-events (list (make-input-event ev-key key-home)
                      (make-input-event ev-key key-end)
                      (make-input-event ev-key key-space)
                      (make-input-event ev-key key-leftbrace)
                      (make-input-event ev-key key-rightbrace)
                      (make-input-event ev-key key-leftshift))

This option takes a list of new “virtual” events that we want our device to be able to send, even if the hardware isn’t configured in the kernel to do so. For example, we want our AK1 to be able to send the SPC key, but the kernel only thinks it can send a, b, and c. Each input event consists of an event type and an event code, which are combined via the make-input-event procedure.

The main event types are ev-key (key/button events), ev-rel (relative-position events, like a mouse), and ev-abs (absolute-position events, like a knob or slider). A large number of event codes are defined in ‘(librekontrol input)’, covering numerous keys, buttons, abs/rel axes, etc. In our case, we’re just going to be generating new key-press events, the names of which are pretty self-explanatory.