completely implemented in userspace
why "libratbag"? cf. marketing 101
Kernel or User-space?
http://github.com/libratbag/libratbag
What happens when you take a kernel guy and a user-space guy to make a lib?
Two parts: external API and HW driver backend
struct ratbag *ctx = ratbag_new(...);
struct ratbag_device *device = ratbag_device_new_from_udev(ctx, udev_device);
struct ratbag_profile *p0 = ratbag_device_get_profile(device, 0);
struct ratbag_resolution *r2 = ratbag_profile_get_resolution(p0, 2);
struct ratbag_button *b1 = ratbag_profile_get_button(p0, 1);
int dpi = ratbag_resolution_get_dpi(r2);
if (ratbag_button_get_action_type(b1) == RATBAG_ACTION_TYPE_KEY)
...
disclaimer: API unstable (v0.0.1)
$ ratbag-command list
$ ratbag-command info /dev/input/event5
$ ratbag-command dpi get /dev/input/event5
$ ratbag-command dpi set 200 /dev/input/event5
$ ratbag-command profile 3 resolution 2 dpi set 200 /dev/input/event5
$ ratbag-command button 2 action set macro \
+KEY_ENTER t50 -KEY_ENTER /dev/input/event5
disclaimer: API unstable (v0.0.1)
prepare to be amazed.
we mean it
totally
full disclosure: GUI sitting on a branch, not in master
disclaimer: no animals were harmed during the making of this presentation