Keyboard Input
The days of running the compositor and just waiting for it to exit are finally over. That's right, now we can actually have an influence on what it does while it's running. In today's adventure, we set up our keyboard input, and configure a few hotkeys to do different things. Are they fun and interesting things? ...uhh, maybe..?
Refactoring
Yeah, code cleanup is never the most exciting change, but we update and restructure a few things to make our lives easier in the long run. Aside from some renamings, we separate our seat code from our graphics code, and define a new bz_breezy struct to pass around some common data.
(e)udev, libinput, and xkbcommon
Here's where the new stuff comes in. We configure (e)udev to monitor hotplug events, libinput with (e)udev and evdev to receive all event types, and then xkbcommon to parse libinput's keyboard events into more-meaningful values.
Our most important change today is adding a hotkey that lets us quit out of our compositor. Once we can quit our compositor, we can replace our fixed-iteration event loop with an actual, condition-based loop, which is necessary for our compositor to run indefinitely. There were also a couple other small things added for a bit of flavor that make our compositor ever-so-slightly more interesting, but they're just temporary spice.
Related Links
Here's the PR for these changes: Github PR #3
The "Linux Device Input" notes page also talks quite a bit about handling input, and includes a few science experiments you can try on your own.