diff mbox

[4/8] sdl2: add UI to toggle head 1 on/off

Message ID 1386648358-25892-5-git-send-email-airlied@gmail.com
State New
Headers show

Commit Message

Dave Airlie Dec. 10, 2013, 4:05 a.m. UTC
From: Dave Airlie <airlied@redhat.com>

This just adds ctrl-alt-n to toggle head 1 on/off for testing and demo purposes.

Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 ui/sdl2.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox

Patch

diff --git a/ui/sdl2.c b/ui/sdl2.c
index dd8cd2b..c52dcd9 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -522,6 +522,13 @@  static void handle_keydown(SDL_Event *ev)
     if (gui_key_modifier_pressed) {
         keycode = sdl_keyevent_to_keycode(&ev->key);
         switch (keycode) {
+        case 0x31:
+            /* spawn a new connected monitor if we have one */
+            if (sdl2_console[1].surface)
+                graphic_hw_notify_state(sdl2_console[1].dcl.con, 0, 0, 0, 0);
+            else
+                graphic_hw_notify_state(sdl2_console[1].dcl.con, 0, 0, 1024, 768);
+            break;
         case 0x21: /* 'f' key on US keyboard */
             toggle_full_screen(scon);
             gui_keysym = 1;