kvm tools: Fix some SDL keyboard translations
PATCH 1/2 kvm tools: Fix some SDL keyboard translations
This patch adds unmapped '<', '>', '|', '-', '+' and '=' which are quite useful in linux.
Signed-off-by Sasha Levin <[email protected]>
--- tools/kvm/ui/sdl.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-)
tools/kvm/ui/sdl.c +7 -3
@@ -20,7 +20,8 @@ static u8 keymap[255] = { [17] = 0x3e, /* 8 */ [18] = 0x46, /* 9 */ [19] = 0x45, /* 9 */ - + [20] = 0x4e, /* - */ + [21] = 0x55, /* + */ [22] = 0x66, /* <backspace> */ [24] = 0x15, /* q */
@@ -47,6 +48,8 @@ static u8 keymap[255] = { [46] = 0x4b, /* l */ [50] = 0x12, /* <left shift> */ + [51] = 0x5d, /* | */ + [52] = 0x1a, /* z */ [53] = 0x22, /* x */
@@ -55,8 +58,9 @@ static u8 keymap[255] = { [56] = 0x32, /* b */ [57] = 0x31, /* n */ [58] = 0x3a, /* m */ - - [61] = 0x4e, /* - */ + [59] = 0x41, /* < */ + [60] = 0x49, /* > */ + [61] = 0x4a, /* / */ [62] = 0x59, /* <right shift> */ [65] = 0x29, /* <space> */ };
Signature · 1 line
1.7.5.3
PATCH 2/2 kvm tools: Use double buffering with SDL
Page flip every time we copy the buffer over instead of invalidating rects.
This should improve performance by letting hardware do the page flipping.
Signed-off-by Sasha Levin <[email protected]>
--- tools/kvm/ui/sdl.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
tools/kvm/ui/sdl.c +2 -2
@@ -91,7 +91,7 @@ static void *sdl__thread(void *p)if (!guest_screen)die ("Unable to create SDL RBG surface" ); - flags =SDL_HWSURFACE |SDL_ASYNCBLIT |SDL_HWACCEL ; + flags =SDL_HWSURFACE |SDL_ASYNCBLIT |SDL_HWACCEL |SDL_DOUBLEBUF ; screen =SDL_SetVideoMode (fb->width, fb->height, fb->depth, flags);if (!screen)
@@ -99,7 +99,7 @@ static void *sdl__thread(void *p)for (;;) {SDL_BlitSurface (guest_screen,NULL , screen,NULL ); -SDL_UpdateRect (screen,0 ,0 ,0 ,0 ); +SDL_Flip (screen);while (SDL_PollEvent (&ev)) {switch (ev.type) {
Signature · 1 line
1.7.5.3