summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.h2
-rw-r--r--mcwm.c21
-rw-r--r--mcwm.man6
3 files changed, 28 insertions, 1 deletions
diff --git a/config.h b/config.h
index 941f12e..0bfb3c3 100644
--- a/config.h
+++ b/config.h
@@ -86,6 +86,8 @@
#define USERKEY_WS8 XK_8
#define USERKEY_WS9 XK_9
#define USERKEY_WS10 XK_0
+#define USERKEY_PREVWS XK_C
+#define USERKEY_NEXTWS XK_V
#define USERKEY_TOPLEFT XK_Y
#define USERKEY_TOPRIGHT XK_U
#define USERKEY_BOTLEFT XK_B
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;
diff --git a/mcwm.man b/mcwm.man
index 24304ab..6d6cd4a 100644
--- a/mcwm.man
+++ b/mcwm.man
@@ -153,6 +153,12 @@ mcicon or 9icon script in the mcwm distribution.
.B 0\-9
go to workspace n, 0-9.
.IP \(bu 2
+.B c
+go to previous workspace.
+.IP \(bu 2
+.B v
+go to next workspace.
+.IP \(bu 2
.B End
close window.
.IP \(bu 2