Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 299507 Details for
Bug 439435
[XEN][5.2][REG] PV domain can not use JP keyboard.
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
pv key event patch
xen-pvfb-04-qemu-pv-keyevent.patch (text/x-patch), 4.68 KB, created by
Alan Matsuoka
on 2008-03-28 17:54:45 UTC
(
hide
)
Description:
pv key event patch
Filename:
MIME Type:
Creator:
Alan Matsuoka
Created:
2008-03-28 17:54:45 UTC
Size:
4.68 KB
patch
obsolete
>--- xen-3.1.0-src/tools/ioemu/hw/xen_machine_pv.c.orig 2008-03-21 13:03:19.000000000 +0900 >+++ xen-3.1.0-src/tools/ioemu/hw/xen_machine_pv.c 2008-03-21 13:12:57.000000000 +0900 >@@ -26,6 +26,48 @@ > #include "xenfb.h" > #include <linux/input.h> > >+/* >+ * Tables to map from scancode to Linux input layer keycode. >+ * Scancodes are hardware-specific. These maps assumes a >+ * standard AT or PS/2 keyboard which is what QEMU feeds us. >+ */ >+static const unsigned char atkbd_set2_keycode[512] = { >+ >+ 0, 67, 65, 63, 61, 59, 60, 88, 0, 68, 66, 64, 62, 15, 41,117, >+ 0, 56, 42, 93, 29, 16, 2, 0, 0, 0, 44, 31, 30, 17, 3, 0, >+ 0, 46, 45, 32, 18, 5, 4, 95, 0, 57, 47, 33, 20, 19, 6,183, >+ 0, 49, 48, 35, 34, 21, 7,184, 0, 0, 50, 36, 22, 8, 9,185, >+ 0, 51, 37, 23, 24, 11, 10, 0, 0, 52, 53, 38, 39, 25, 12, 0, >+ 0, 89, 40, 0, 26, 13, 0, 0, 58, 54, 28, 27, 0, 43, 0, 85, >+ 0, 86, 91, 90, 92, 0, 14, 94, 0, 79,124, 75, 71,121, 0, 0, >+ 82, 83, 80, 76, 77, 72, 1, 69, 87, 78, 81, 74, 55, 73, 70, 99, >+ >+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, >+ 217,100,255, 0, 97,165, 0, 0,156, 0, 0, 0, 0, 0, 0,125, >+ 173,114, 0,113, 0, 0, 0,126,128, 0, 0,140, 0, 0, 0,127, >+ 159, 0,115, 0,164, 0, 0,116,158, 0,150,166, 0, 0, 0,142, >+ 157, 0, 0, 0, 0, 0, 0, 0,155, 0, 98, 0, 0,163, 0, 0, >+ 226, 0, 0, 0, 0, 0, 0, 0, 0,255, 96, 0, 0, 0,143, 0, >+ 0, 0, 0, 0, 0, 0, 0, 0, 0,107, 0,105,102, 0, 0,112, >+ 110,111,108,112,106,103, 0,119, 0,118,109, 0, 99,104,119, 0, >+ >+}; >+ >+static const unsigned char atkbd_unxlate_table[128] = { >+ >+ 0,118, 22, 30, 38, 37, 46, 54, 61, 62, 70, 69, 78, 85,102, 13, >+ 21, 29, 36, 45, 44, 53, 60, 67, 68, 77, 84, 91, 90, 20, 28, 27, >+ 35, 43, 52, 51, 59, 66, 75, 76, 82, 14, 18, 93, 26, 34, 33, 42, >+ 50, 49, 58, 65, 73, 74, 89,124, 17, 41, 88, 5, 6, 4, 12, 3, >+ 11, 2, 10, 1, 9,119,126,108,117,125,123,107,115,116,121,105, >+ 114,122,112,113,127, 96, 97,120, 7, 15, 23, 31, 39, 47, 55, 63, >+ 71, 79, 86, 94, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 87,111, >+ 19, 25, 57, 81, 83, 92, 95, 98, 99,100,101,103,104,106,109,110 >+ >+}; >+ >+static unsigned char scancode2linux[512]; >+ > /* A convenient function for munging pixels between different depths */ > #define BLT(SRC_T,DST_T,RLS,GLS,BLS,RRS,GRS,BRS,RM,GM,BM) \ > for (line = y ; line < h ; line++) { \ >@@ -84,12 +126,36 @@ static void xen_pvfb_guest_copy(struct x > dpy_update(ds, x, y, w, h); > } > >- >-/* Send a keypress from the client to the guest OS */ >-static void xen_pvfb_put_keycode(void *opaque, int keycode) >+/* >+ * Send a key event from the client to the guest OS >+ * QEMU gives us a raw scancode from an AT / PS/2 style keyboard. >+ * We have to turn this into a Linux Input layer keycode. >+ * >+ * Extra complexity from the fact that with extended scancodes >+ * (like those produced by arrow keys) this method gets called >+ * twice, but we only want to send a single event. So we have to >+ * track the '0xe0' scancode state & collapse the extended keys >+ * as needed. >+ * >+ * Wish we could just send scancodes straight to the guest which >+ * already has code for dealing with this... >+ */ >+static void xen_pvfb_key_event(void *opaque, int scancode) > { >- struct xenfb *xenfb = (struct xenfb*)opaque; >- xenfb_send_key(xenfb, keycode & 0x80 ? 0 : 1, keycode & 0x7f); >+ static int extended = 0; >+ int down = 1; >+ if (scancode == 0xe0) { >+ extended = 1; >+ return; >+ } else if (scancode & 0x80) { >+ scancode &= 0x7f; >+ down = 0; >+ } >+ if (extended) { >+ scancode |= 0x80; >+ extended = 0; >+ } >+ xenfb_send_key(opaque, down, scancode2linux[scancode]); > } > > /* Send a mouse event from the client to the guest OS */ >@@ -166,6 +232,14 @@ static void xen_init_pv(uint64_t ram_siz > struct xenfb *xenfb; > extern int domid; > int fd; >+ int i; >+ >+ /* Prepare scancode mapping table */ >+ for (i = 0; i < 128; i++) { >+ scancode2linux[i] = atkbd_set2_keycode[atkbd_unxlate_table[i]]; >+ scancode2linux[i | 0x80] = >+ atkbd_set2_keycode[atkbd_unxlate_table[i] | 0x80]; >+ } > > /* Prepare PVFB state */ > xenfb = xenfb_new(); >@@ -192,7 +266,7 @@ static void xen_init_pv(uint64_t ram_siz > xenfb); > > /* Register our keyboard & mouse handlers */ >- qemu_add_kbd_event_handler(xen_pvfb_put_keycode, xenfb); >+ qemu_add_kbd_event_handler(xen_pvfb_key_event, xenfb); > qemu_add_mouse_event_handler(xen_pvfb_mouse_event, xenfb, > xenfb->abs_pointer_wanted > );
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 439435
:
299506
| 299507