summaryrefslogtreecommitdiff
path: root/mcwm.c
diff options
context:
space:
mode:
authorPer Cederqvist <ceder@lysator.liu.se>2013-02-08 11:38:51 +0100
committerMichael Cardell Widerkrantz <mc@hack.org>2013-02-08 11:38:51 +0100
commiteadc9667af405353bc3ae5e94d3f903dc4fc4c2d (patch)
treea46e76b12a3aa7c51a4ade962945094305e535ba /mcwm.c
parentd79df47289fd9754e2c84d54ada0ac42d8d93c8b (diff)
downloadmcwm-eadc9667af405353bc3ae5e94d3f903dc4fc4c2d.zip
Added support for moving to previous and next workspace. Thanks ceder!
Diffstat (limited to 'mcwm.c')
-rw-r--r--mcwm.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/mcwm.c b/mcwm.c
index 3fcfa5e..fab3474 100644
--- a/mcwm.c
+++ b/mcwm.c
@@ -129,6 +129,8 @@ typedef enum {
KEY_PREVSCR,
KEY_NEXTSCR,
KEY_ICONIFY,
+ KEY_PREVWS,
+ KEY_NEXTWS,
KEY_MAX
} key_enum_t;
@@ -258,6 +260,8 @@ struct keys
{ USERKEY_PREVSCREEN, 0 },
{ USERKEY_NEXTSCREEN, 0 },
{ USERKEY_ICONIFY, 0 },
+ { USERKEY_PREVWS, 0 },
+ { USERKEY_NEXTWS, 0 },
};
/* All keycodes generating our MODKEY mask. */
@@ -3175,7 +3179,22 @@ void handle_keypress(xcb_key_press_event_t *ev)
hide(focuswin);
}
break;
-
+
+ case KEY_PREVWS:
+ if (curws > 0)
+ {
+ changeworkspace(curws - 1);
+ }
+ else
+ {
+ changeworkspace(WORKSPACES - 1);
+ }
+ break;
+
+ case KEY_NEXTWS:
+ changeworkspace((curws + 1) % WORKSPACES);
+ break;
+
default:
/* Ignore other keys. */
break;