[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH][0/9] Translate some control characters in the qemu monitor.



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@xxxxxxxxx>
Signed-off-by: Arun Sharma <arun.sharma@xxxxxxxxx>

diff -r 8d9c8ed30b0f -r 1049ab5dc16b tools/ioemu/vnc.c
--- a/tools/ioemu/vnc.c Tue Jul 12 20:46:22 2005
+++ b/tools/ioemu/vnc.c Tue Jul 12 21:49:20 2005
@@ -393,7 +393,28 @@
                        keycode>>=8;
                }
        } else if(down) {
-               kbd_put_keysym(keySym);
+            int qemu_keysym = 0;
+            if (keySym <= 128) { /* normal ascii */
+                qemu_keysym = keySym;
+            } else {
+                switch(keySym) {
+                    case XK_Up: qemu_keysym = QEMU_KEY_UP; break;
+                    case XK_Down: qemu_keysym = QEMU_KEY_DOWN; break;
+                    case XK_Left: qemu_keysym = QEMU_KEY_LEFT; break;
+                    case XK_Right: qemu_keysym = QEMU_KEY_RIGHT; break;
+                    case XK_Home: qemu_keysym = QEMU_KEY_HOME; break;
+                    case XK_End: qemu_keysym = QEMU_KEY_END; break;
+                    case XK_Page_Up: qemu_keysym = QEMU_KEY_PAGEUP; break;
+                    case XK_Page_Down: qemu_keysym = QEMU_KEY_PAGEDOWN; break;
+                    case XK_BackSpace: qemu_keysym = QEMU_KEY_BACKSPACE; break;
+                    case XK_Delete: qemu_keysym = QEMU_KEY_DELETE; break;
+                    case XK_Return:
+                    case XK_Linefeed: qemu_keysym = keySym; break;
+                    default: break;
+                }
+            }
+            if (qemu_keysym != 0)
+                kbd_put_keysym(qemu_keysym);
        }
        if(down) {
                if(keySym==XK_Control_L)

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.