Updated README.md, mwm.c.

This commit is contained in:
Luis Lavaire 2024-11-14 13:26:36 -06:00
parent 5e4007b9d1
commit b699198154
2 changed files with 7 additions and 8 deletions

4
mwm.c
View file

@ -4,7 +4,7 @@
#define stk(s) XKeysymToKeycode(d, XStringToKeysym(s))
#define K(k, x) if (e.xkey.keycode == stk(k)) { x; }
#define E(_, x) if (e.type == _) { x; }
#define gks(...) const char *l[] = { __VA_ARGS__ }; \
#define grab(...) const char *l[] = { __VA_ARGS__ }; \
for (size_t i = 0; i < sizeof(l) / sizeof(*l); ++i) \
XGrabKey (d, stk(l[i]), Mod4Mask, r, 1, 1, 1);
@ -12,7 +12,7 @@ int main () {
Display *d = XOpenDisplay(0); Window r = DefaultRootWindow(d); XEvent e;
XSelectInput (d, r, SubstructureRedirectMask);
gks ("q", "n", "l", "space", "Return", "Right", "Left", "Up", "Down");
grab ("q", "n", "l", "space", "Return", "Right", "Left", "Up", "Down");
while (!XNextEvent (d, &e)) {
E (KeyPress,