Re-implement the 'mode' command
This commit is contained in:
parent
c6352ded4e
commit
39b1c1bf75
|
@ -171,7 +171,7 @@ void grab_all_keys(xcb_connection_t *conn, bool bind_mode_switch);
|
||||||
* Switches the key bindings to the given mode, if the mode exists
|
* 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
|
* Returns a pointer to the Binding with the specified modifiers and keycode
|
||||||
|
|
|
@ -112,7 +112,7 @@ border { return TOK_BORDER; }
|
||||||
normal { return TOK_NORMAL; }
|
normal { return TOK_NORMAL; }
|
||||||
none { return TOK_NONE; }
|
none { return TOK_NONE; }
|
||||||
1pixel { return TOK_1PIXEL; }
|
1pixel { return TOK_1PIXEL; }
|
||||||
mode { return TOK_MODE; }
|
mode { BEGIN(WANT_QSTRING); return TOK_MODE; }
|
||||||
tiling { return TOK_TILING; }
|
tiling { return TOK_TILING; }
|
||||||
floating { return TOK_FLOATING; }
|
floating { return TOK_FLOATING; }
|
||||||
toggle { return TOK_TOGGLE; }
|
toggle { return TOK_TOGGLE; }
|
||||||
|
|
|
@ -352,6 +352,7 @@ operation:
|
||||||
| mark
|
| mark
|
||||||
| resize
|
| resize
|
||||||
| nop
|
| nop
|
||||||
|
| mode
|
||||||
;
|
;
|
||||||
|
|
||||||
exec:
|
exec:
|
||||||
|
@ -784,3 +785,10 @@ direction:
|
||||||
| TOK_LEFT { $$ = TOK_LEFT; }
|
| TOK_LEFT { $$ = TOK_LEFT; }
|
||||||
| TOK_RIGHT { $$ = TOK_RIGHT; }
|
| TOK_RIGHT { $$ = TOK_RIGHT; }
|
||||||
;
|
;
|
||||||
|
|
||||||
|
mode:
|
||||||
|
TOK_MODE STR
|
||||||
|
{
|
||||||
|
switch_mode($2);
|
||||||
|
}
|
||||||
|
;
|
||||||
|
|
|
@ -150,7 +150,7 @@ void grab_all_keys(xcb_connection_t *conn, bool bind_mode_switch) {
|
||||||
* Switches the key bindings to the given mode, if the mode exists
|
* 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;
|
struct Mode *mode;
|
||||||
|
|
||||||
LOG("Switching to mode %s\n", new_mode);
|
LOG("Switching to mode %s\n", new_mode);
|
||||||
|
|
Loading…
Reference in New Issue