mirror of
https://github.com/dylanaraps/sowm.git
synced 2025-05-19 01:20:23 -07:00
Fix: Shift mask now being recognized
This commit is contained in:
parent
85ee7ec48e
commit
66336521ed
10
sowm.c
10
sowm.c
@ -49,7 +49,7 @@ static void ws_go(const Arg arg);
|
|||||||
static int xerror() { return 0;}
|
static int xerror() { return 0;}
|
||||||
|
|
||||||
static client *list = {0}, *ws_list[10] = {0}, *cur;
|
static client *list = {0}, *ws_list[10] = {0}, *cur;
|
||||||
static int ws = 1, sw, sh, wx, wy, numlock;
|
static int ws = 1, sw, sh, wx, wy;
|
||||||
static unsigned int ww, wh;
|
static unsigned int ww, wh;
|
||||||
|
|
||||||
static Display *d;
|
static Display *d;
|
||||||
@ -71,7 +71,6 @@ static void (*events[LASTEvent])(XEvent *e) = {
|
|||||||
#define win (client *t=0, *c=list; c && t!=list->prev; t=c, c=c->next)
|
#define win (client *t=0, *c=list; c && t!=list->prev; t=c, c=c->next)
|
||||||
#define ws_save(W) ws_list[W] = list
|
#define ws_save(W) ws_list[W] = list
|
||||||
#define ws_sel(W) list = ws_list[ws = W]
|
#define ws_sel(W) list = ws_list[ws = W]
|
||||||
#define mask(M) (M & ~(numlock | LockMask))
|
|
||||||
|
|
||||||
#define win_size(W, gx, gy, gw, gh) \
|
#define win_size(W, gx, gy, gw, gh) \
|
||||||
XGetGeometry(d, W, &(Window){0}, gx, gy, gw, gh, \
|
XGetGeometry(d, W, &(Window){0}, gx, gy, gw, gh, \
|
||||||
@ -112,13 +111,10 @@ void notify_motion(XEvent *e) {
|
|||||||
void key_press(XEvent *e) {
|
void key_press(XEvent *e) {
|
||||||
KeySym keysym = XkbKeycodeToKeysym(d, e->xkey.keycode, 0, 0);
|
KeySym keysym = XkbKeycodeToKeysym(d, e->xkey.keycode, 0, 0);
|
||||||
|
|
||||||
for (unsigned int i=0; i < sizeof(keys)/sizeof(*keys); ++i) {
|
for (unsigned int i=0; i < sizeof(keys)/sizeof(*keys); ++i)
|
||||||
numlock = ((e->xkey.state & keys[i].mod) == keys[i].mod);
|
if (keys[i].mod == e->xkey.state &&
|
||||||
|
|
||||||
if (mask(keys[i].mod) == mask(e->xkey.state) &&
|
|
||||||
keys[i].keysym == keysym)
|
keys[i].keysym == keysym)
|
||||||
keys[i].function(keys[i].arg);
|
keys[i].function(keys[i].arg);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void button_press(XEvent *e) {
|
void button_press(XEvent *e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user