diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-01-15 20:53:13 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-15 20:53:13 -0500 |
commit | b331c5c2c5cbb94df66789e52ab87598647e0056 (patch) | |
tree | 24be1a00880947a25b9f9f8a12129bbb371b1643 /rootston/keyboard.c | |
parent | c690420501a35ee83bf6afeb52139b3da2c455c2 (diff) | |
parent | 0eebaf98d0550a9ea7adb743a5b85634f1d76b73 (diff) |
Merge pull request #549 from emersion/output-enabled
Add wlr_output::enabled
Diffstat (limited to 'rootston/keyboard.c')
-rw-r--r-- | rootston/keyboard.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/rootston/keyboard.c b/rootston/keyboard.c index 7b281308..14199afd 100644 --- a/rootston/keyboard.c +++ b/rootston/keyboard.c @@ -2,6 +2,7 @@ #include <stdint.h> #include <stdlib.h> #include <unistd.h> +#include <stdbool.h> #include <wayland-server.h> #include <wlr/types/wlr_input_device.h> #include <wlr/types/wlr_pointer.h> @@ -85,6 +86,8 @@ static void pressed_keysyms_update(xkb_keysym_t *pressed_keysyms, static const char *exec_prefix = "exec "; +static bool outputs_enabled = true; + static void keyboard_binding_execute(struct roots_keyboard *keyboard, const char *command) { struct roots_seat *seat = keyboard->seat; @@ -119,6 +122,12 @@ static void keyboard_binding_execute(struct roots_keyboard *keyboard, } } else if (strcmp(command, "nop") == 0) { wlr_log(L_DEBUG, "nop command"); + } else if (strcmp(command, "toggle_outputs") == 0) { + outputs_enabled = !outputs_enabled; + struct roots_output *output; + wl_list_for_each(output, &keyboard->input->server->desktop->outputs, link) { + wlr_output_enable(output->wlr_output, outputs_enabled); + } } else { wlr_log(L_ERROR, "unknown binding command: %s", command); } |