Sometimes, when the mouse button gets stuck, state contains the bit for
BUTTON_MASK_1 (or other buttons). We filter them out to continue processing
keys correctly.
/* Remove the numlock bit, all other bits are modifiers we can bind to */
uint16_t state_filtered = event->state & ~(xcb_numlock_mask | XCB_MOD_MASK_LOCK);
+ /* Only use the lower 8 bits of the state (modifier masks) so that mouse
+ * button masks are filtered out */
+ state_filtered &= 0xFF;
+
/* Find the binding */
Binding *bind;
TAILQ_FOREACH(bind, &bindings, bindings)