ia64/xen-unstable

changeset 5849:5f77050a58f6

Translate some control characters in the qemu monitor.

This removes odd control characters displayed in the qemu monitor with vnc

Signed-off-by: Edwin Zhain <edwin.zhai@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
author kaf24@firebug.cl.cam.ac.uk
date Mon Jul 25 21:00:30 2005 +0000 (2005-07-25)
parents 50fd1e053b1a
children 3acc0ae6a001
files tools/ioemu/vnc.c
line diff
     1.1 --- a/tools/ioemu/vnc.c	Mon Jul 25 20:41:31 2005 +0000
     1.2 +++ b/tools/ioemu/vnc.c	Mon Jul 25 21:00:30 2005 +0000
     1.3 @@ -393,7 +393,28 @@ static void vnc_process_key(rfbBool down
     1.4  			keycode>>=8;
     1.5  		}
     1.6  	} else if(down) {
     1.7 -		kbd_put_keysym(keySym);
     1.8 +            int qemu_keysym = 0;
     1.9 +            if (keySym <= 128) { /* normal ascii */
    1.10 +                qemu_keysym = keySym;
    1.11 +            } else {
    1.12 +                switch(keySym) {
    1.13 +                    case XK_Up: qemu_keysym = QEMU_KEY_UP; break;
    1.14 +                    case XK_Down: qemu_keysym = QEMU_KEY_DOWN; break;
    1.15 +                    case XK_Left: qemu_keysym = QEMU_KEY_LEFT; break;
    1.16 +                    case XK_Right: qemu_keysym = QEMU_KEY_RIGHT; break;
    1.17 +                    case XK_Home: qemu_keysym = QEMU_KEY_HOME; break;
    1.18 +                    case XK_End: qemu_keysym = QEMU_KEY_END; break;
    1.19 +                    case XK_Page_Up: qemu_keysym = QEMU_KEY_PAGEUP; break;
    1.20 +                    case XK_Page_Down: qemu_keysym = QEMU_KEY_PAGEDOWN; break;
    1.21 +                    case XK_BackSpace: qemu_keysym = QEMU_KEY_BACKSPACE; break;
    1.22 +                    case XK_Delete: qemu_keysym = QEMU_KEY_DELETE; break;
    1.23 +                    case XK_Return:
    1.24 +                    case XK_Linefeed: qemu_keysym = keySym; break;
    1.25 +                    default: break;
    1.26 +                }
    1.27 +            }
    1.28 +            if (qemu_keysym != 0)
    1.29 +                kbd_put_keysym(qemu_keysym);
    1.30  	}
    1.31  	if(down) {
    1.32  		if(keySym==XK_Control_L)