* Switches the key bindings to the given mode, if the mode exists
*
*/
-void switch_mode(xcb_connection_t *conn, const char *new_mode);
+void switch_mode(const char *new_mode);
/**
* Returns a pointer to the Binding with the specified modifiers and keycode
normal { return TOK_NORMAL; }
none { return TOK_NONE; }
1pixel { return TOK_1PIXEL; }
-mode { return TOK_MODE; }
+mode { BEGIN(WANT_QSTRING); return TOK_MODE; }
tiling { return TOK_TILING; }
floating { return TOK_FLOATING; }
toggle { return TOK_TOGGLE; }
| mark
| resize
| nop
+ | mode
;
exec:
| TOK_LEFT { $$ = TOK_LEFT; }
| TOK_RIGHT { $$ = TOK_RIGHT; }
;
+
+mode:
+ TOK_MODE STR
+ {
+ switch_mode($2);
+ }
+ ;
* Switches the key bindings to the given mode, if the mode exists
*
*/
-void switch_mode(xcb_connection_t *conn, const char *new_mode) {
+void switch_mode(const char *new_mode) {
struct Mode *mode;
LOG("Switching to mode %s\n", new_mode);