sxhkd-rc

[fork] simple X hotkey daemon (but for the rc shell)
Log | Files | Refs | README | LICENSE

commit e57f9df6d6d5f768d947d0d00963468849bc41be
parent bc1b768d391923290410d420f1045c799345f365
Author: Bastien Dejean <nihilhill@gmail.com>
Date:   Sat,  5 Jan 2013 16:48:39 +0100

Only keep modifier masks bits from event state

Otherwise, mouse release hotkeys will fail because the pressed button
bit mask is part of the state of the button release event.

Diffstat:
Mkeys.h | 1+
Msxhkd.c | 2+-
2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/keys.h b/keys.h @@ -4,6 +4,7 @@ #include "sxhkd.h" #define KEYSYMS_PER_KEYCODE 4 +#define MOD_STATE_FIELD 255 #define NUM_MOD 8 #define SEQ_MIN_LEN 3 #define RELEASE_PREFIX '@' diff --git a/sxhkd.c b/sxhkd.c @@ -164,7 +164,7 @@ void key_button_event(xcb_generic_event_t *evt, xcb_event_mask_t event_mask) modfield = e->state; PRINTF("button release %u %u\n", button, modfield); } - modfield &= ~lockfield; + modfield &= ~lockfield & MOD_STATE_FIELD; if (keysym != XCB_NO_SYMBOL || button != XCB_NONE) { hotkey_t *hk = find_hotkey(keysym, button, modfield, event_mask); if (hk != NULL) {