提交 d6a65ba3 编写于 作者: J Jan Kiszka 提交者: Anthony Liguori

sdl: Add zoom hot keys

Allow to enlarge or shrink the screen via CTRL-ALT-+/-. In contrast to
scaling the window, these controls always preserve the aspect ratio of
the current console.

CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 35b0f237
......@@ -288,6 +288,14 @@ then the modifier is Ctrl-Alt-Shift (instead of Ctrl-Alt) and if you use
@kindex Ctrl-Alt-f
Toggle full screen
@item Ctrl-Alt-+
@kindex Ctrl-Alt-+
Enlarge the screen
@item Ctrl-Alt--
@kindex Ctrl-Alt--
Shrink the screen
@item Ctrl-Alt-u
@kindex Ctrl-Alt-u
Restore the screen's un-scaled dimensions
......
......@@ -651,6 +651,19 @@ static void sdl_refresh(DisplayState *ds)
absolute_mouse_grab();
}
break;
case 0x1b: /* '+' */
case 0x35: /* '-' */
if (!gui_fullscreen) {
int width = MAX(real_screen->w +
(keycode == 0x1b ? 50 : -50), 160);
int height = (ds_get_height(ds) * width) /
ds_get_width(ds);
sdl_scale(ds, width, height);
vga_hw_invalidate();
vga_hw_update();
gui_keysym = 1;
}
default:
break;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册