All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] keymap support for PVFB
@ 2006-12-28  4:11 Junko Ichino
  2006-12-28 16:02 ` Ewan Mellor
  2007-01-10 20:18 ` Markus Armbruster
  0 siblings, 2 replies; 24+ messages in thread
From: Junko Ichino @ 2006-12-28  4:11 UTC (permalink / raw)
  To: Xen-devel

[-- Attachment #1: Type: text/plain, Size: 406 bytes --]

Hi all,

My name is Junko Ichino.


Currently, Paravirtualized frame buffer is supporting only US keymap.

I'm trying to make a patch to support several keymaps 
for Paravirtualized frame buffer, which uses QEMU's keymap.

But, some special keys cannot be input in Japanese keymap.
For example, backslash and underscore.
I'm investigating this problem now. 
Where is the problem?


Thanks,
-
Junko Ichino


[-- Attachment #2: pvfb-keymap.patch --]
[-- Type: application/octet-stream, Size: 6615 bytes --]

# HG changeset patch
# User ichino.junko@jp.fujitsu.com
# Node ID d5f18d970be9bc0bb4d4c308f41bb32902babb2d
# Parent  367f0c6efe2178e26ba0194ca795ff098e22a80b
keymap support for vncfb

Signed-off-by: Junko Ichino <ichino.junko@jp.fujitsu.com>
Signed-off-by: Takanori Kasai <Kasai.Takanori@jp.fujitsu.com>
Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com>

diff -r 367f0c6efe21 -r d5f18d970be9 tools/xenfb/Makefile
--- a/tools/xenfb/Makefile	Sat Dec 23 21:32:05 2006 +0000
+++ b/tools/xenfb/Makefile	Thu Dec 28 11:27:14 2006 +0900
@@ -1,7 +1,7 @@ XEN_ROOT=../..
 XEN_ROOT=../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-CFLAGS += -I$(XEN_LIBXC) -I$(XEN_XENSTORE) -I$(XEN_ROOT)/linux-2.6-xen-sparse/include
+CFLAGS += -I$(XEN_LIBXC) -I$(XEN_XENSTORE) -I$(XEN_ROOT)/linux-2.6-xen-sparse/include -I$(XEN_ROOT)/tools/ioemu
 LDFLAGS += -L$(XEN_LIBXC) -L$(XEN_XENSTORE)
 
 INSTALL         = install
diff -r 367f0c6efe21 -r d5f18d970be9 tools/xenfb/vncfb.c
--- a/tools/xenfb/vncfb.c	Sat Dec 23 21:32:05 2006 +0000
+++ b/tools/xenfb/vncfb.c	Thu Dec 28 11:27:14 2006 +0900
@@ -11,142 +11,13 @@
 #include <xs.h>
 #include "xenfb.h"
 
-static int xk2linux[0x10000] = {
-	[XK_a] = KEY_A,
-	[XK_b] = KEY_B,
-	[XK_c] = KEY_C,
-	[XK_d] = KEY_D,
-	[XK_e] = KEY_E,
-	[XK_f] = KEY_F,
-	[XK_g] = KEY_G,
-	[XK_h] = KEY_H,
-	[XK_i] = KEY_I,
-	[XK_j] = KEY_J,
-	[XK_k] = KEY_K,
-	[XK_l] = KEY_L,
-	[XK_m] = KEY_M,
-	[XK_n] = KEY_N,
-	[XK_o] = KEY_O,
-	[XK_p] = KEY_P,
-	[XK_q] = KEY_Q,
-	[XK_r] = KEY_R,
-	[XK_s] = KEY_S,
-	[XK_t] = KEY_T,
-	[XK_u] = KEY_U,
-	[XK_v] = KEY_V,
-	[XK_w] = KEY_W,
-	[XK_x] = KEY_X,
-	[XK_y] = KEY_Y,
-	[XK_z] = KEY_Z,
-	[XK_A] = KEY_A,
-	[XK_B] = KEY_B,
-	[XK_C] = KEY_C,
-	[XK_D] = KEY_D,
-	[XK_E] = KEY_E,
-	[XK_F] = KEY_F,
-	[XK_G] = KEY_G,
-	[XK_H] = KEY_H,
-	[XK_I] = KEY_I,
-	[XK_J] = KEY_J,
-	[XK_K] = KEY_K,
-	[XK_L] = KEY_L,
-	[XK_M] = KEY_M,
-	[XK_N] = KEY_N,
-	[XK_O] = KEY_O,
-	[XK_P] = KEY_P,
-	[XK_Q] = KEY_Q,
-	[XK_R] = KEY_R,
-	[XK_S] = KEY_S,
-	[XK_T] = KEY_T,
-	[XK_U] = KEY_U,
-	[XK_V] = KEY_V,
-	[XK_W] = KEY_W,
-	[XK_X] = KEY_X,
-	[XK_Y] = KEY_Y,
-	[XK_Z] = KEY_Z,
-	[XK_0] = KEY_0,
-	[XK_1] = KEY_1,
-	[XK_2] = KEY_2,
-	[XK_3] = KEY_3,
-	[XK_4] = KEY_4,
-	[XK_5] = KEY_5,
-	[XK_6] = KEY_6,
-	[XK_7] = KEY_7,
-	[XK_8] = KEY_8,
-	[XK_9] = KEY_9,
-	[XK_Return] = KEY_ENTER,
-	[XK_BackSpace] = KEY_BACKSPACE,
-	[XK_Tab] = KEY_TAB,
-	[XK_Pause] = KEY_PAUSE,
-	[XK_Delete] = KEY_DELETE,
-	[XK_slash] = KEY_SLASH,
-	[XK_minus] = KEY_MINUS,
-	[XK_equal] = KEY_EQUAL,
-	[XK_Escape] = KEY_ESC,
-	[XK_braceleft] = KEY_LEFTBRACE,
-	[XK_braceright] = KEY_RIGHTBRACE,
-	[XK_bracketleft] = KEY_LEFTMETA,
-	[XK_bracketright] = KEY_RIGHTMETA,
-	[XK_Control_L] = KEY_LEFTCTRL,
-	[XK_Control_R] = KEY_RIGHTCTRL,
-	[XK_Shift_L] = KEY_LEFTSHIFT,
-	[XK_Shift_R] = KEY_RIGHTSHIFT,
-	[XK_Alt_L] = KEY_LEFTALT,
-	[XK_Alt_R] = KEY_RIGHTALT,
-	[XK_semicolon] = KEY_SEMICOLON, 
-	[XK_apostrophe] = KEY_APOSTROPHE,
-	[XK_grave] = KEY_GRAVE,
-	[XK_backslash] = KEY_BACKSLASH,
-	[XK_comma] = KEY_COMMA,
-	[XK_period] = KEY_DOT,
-	[XK_space] = KEY_SPACE,
-	[XK_Caps_Lock] = KEY_CAPSLOCK,
-	[XK_Num_Lock] = KEY_NUMLOCK,
-	[XK_Scroll_Lock] = KEY_SCROLLLOCK,
-	[XK_Sys_Req] = KEY_SYSRQ,
-	[XK_Linefeed] = KEY_LINEFEED,
-	[XK_Home] = KEY_HOME,
-	[XK_Pause] = KEY_PAUSE,
-	[XK_F1] = KEY_F1,
-	[XK_F2] = KEY_F2,
-	[XK_F3] = KEY_F3,
-	[XK_F4] = KEY_F4,
-	[XK_F5] = KEY_F5,
-	[XK_F6] = KEY_F6,
-	[XK_F7] = KEY_F7,
-	[XK_F8] = KEY_F8,
-	[XK_F9] = KEY_F9,
-	[XK_F10] = KEY_F10,
-	[XK_F11] = KEY_F11,
-	[XK_F12] = KEY_F12,
-	[XK_Up] = KEY_UP,
-	[XK_Page_Up] = KEY_PAGEUP,
-	[XK_Left] = KEY_LEFT,
-	[XK_Right] = KEY_RIGHT,
-	[XK_End] = KEY_END,
-	[XK_Down] = KEY_DOWN,
-	[XK_Page_Down] = KEY_PAGEDOWN,
-	[XK_Insert] = KEY_INSERT, 
-	[XK_colon] = KEY_SEMICOLON,
-	[XK_quotedbl] = KEY_APOSTROPHE,
-	[XK_less] = KEY_COMMA,
-	[XK_greater] = KEY_DOT,
-	[XK_question] = KEY_SLASH,
-	[XK_bar] = KEY_BACKSLASH,
-	[XK_asciitilde] = KEY_GRAVE,
-	[XK_exclam] = KEY_1,
-	[XK_at] = KEY_2,
-	[XK_numbersign] = KEY_3,
-	[XK_dollar] = KEY_4,
-	[XK_percent] = KEY_5,
-	[XK_asciicircum] = KEY_6,
-	[XK_ampersand] = KEY_7,
-	[XK_asterisk] = KEY_8,
-	[XK_parenleft] = KEY_9,
-	[XK_parenright] = KEY_0,
-	[XK_underscore] = KEY_MINUS,
-	[XK_plus] = KEY_EQUAL,
-};
+#define qemu_mallocz(size) calloc(1, (size))
+#include "config-host.h"
+static const char *bios_dir = CONFIG_QEMU_SHAREDIR;
+#include "vnc_keysym.h"
+#include "keymaps.c"
+
+static void *kbd_layout;
 
 static int btnmap[] = {
 	BTN_LEFT, BTN_MIDDLE, BTN_RIGHT, BTN_FORWARD, BTN_BACK
@@ -165,13 +36,16 @@ static void on_kbd_event(rfbBool down, r
 	 */
 	rfbScreenInfoPtr server = cl->screen;
 	struct xenfb *xenfb = server->screenData;
-	if (keycode >= sizeof(xk2linux) / sizeof(*xk2linux))
+
+	if( keycode >= 'A' && keycode <= 'Z' )
+		keycode += 'a' - 'A';
+
+	int scancode = keysym2scancode(kbd_layout, keycode);
+	if (scancode == 0)
 		return;
-	if (xk2linux[keycode] == 0)
-		return;
-	if (xenfb_send_key(xenfb, down, xk2linux[keycode]) < 0)
+	if (xenfb_send_key(xenfb, down, scancode) < 0)
 		fprintf(stderr, "Key %d %s lost (%s)\n",
-			xk2linux[keycode], down ? "down" : "up",
+			scancode, down ? "down" : "up",
 			strerror(errno));
 }
 
@@ -305,6 +179,7 @@ static struct option options[] = {
 	{ "title", 1, NULL, 't' },
 	{ "unused", 0, NULL, 'u' },
 	{ "listen", 1, NULL, 'l' },
+	{ "keymap", 1, NULL, 'k' },
 	{ NULL }
 };
 
@@ -318,6 +193,7 @@ int main(int argc, char **argv)
 	int domid = -1, port = -1;
 	char *title = NULL;
 	char *listen = NULL;
+	char *keymap = NULL;
 	bool unused = false;
 	int opt;
 	struct xenfb *xenfb;
@@ -331,7 +207,7 @@ int main(int argc, char **argv)
 
 	vncpasswd[0] = '\0';
 
-	while ((opt = getopt_long(argc, argv, "d:p:t:u", options,
+	while ((opt = getopt_long(argc, argv, "d:p:t:uk:", options,
 				  NULL)) != -1) {
 		switch (opt) {
                 case 'd':
@@ -359,6 +235,9 @@ int main(int argc, char **argv)
                 case 'l':
 			listen = strdup(optarg);
 			break;
+                case 'k':
+			keymap = strdup(optarg);
+			break;
 		case '?':
 			exit(1);
                 }
@@ -378,7 +257,12 @@ int main(int argc, char **argv)
 		fprintf(stderr, "Invalid port specified\n");
 		exit(1);
         }
-            
+
+	if (keymap == NULL){
+		keymap = "en-us";
+	}
+	kbd_layout = init_keyboard_layout(keymap);
+
 	fake_argv[2] = portstr;
 
         if (title != NULL)

[-- Attachment #3: tools-build.patch --]
[-- Type: application/octet-stream, Size: 1588 bytes --]

# HG changeset patch
# User kasai.takanori@jp.fujitsu.com
# Node ID fd6dad0fefc84cdb5e4390f204a80cf5c3be7bcb
# Parent  d5f18d970be9bc0bb4d4c308f41bb32902babb2d
The build order change for keyboard selection of pvfb

Signed-off-by: Takanori Kasai <Kasai.Takanori@jp.fujitsu.com>
Signed-off-by: Junko Ichino <ichino.junko@jp.fujitsu.com>
Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com>

diff -r d5f18d970be9 -r fd6dad0fefc8 tools/Makefile
--- a/tools/Makefile	Thu Dec 28 11:27:14 2006 +0900
+++ b/tools/Makefile	Thu Dec 28 11:31:05 2006 +0900
@@ -19,8 +19,9 @@ SUBDIRS-y += libaio
 SUBDIRS-y += libaio
 SUBDIRS-y += blktap
 SUBDIRS-y += libfsimage
-SUBDIRS-$(XENFB_TOOLS) += xenfb
 SUBDIRS-$(LIBXENAPI_BINDINGS) += libxen
+
+POST_SUBDIRS-$(XENFB_TOOLS) += xenfb
 
 # These don't cross-compile
 ifeq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
@@ -34,6 +35,9 @@ all: check
 		$(MAKE) -C $$subdir $@; \
 	done
 	$(MAKE) ioemu
+	@set -e; for subdir in $(POST_SUBDIRS-y); do \
+		$(MAKE) -C $$subdir $@; \
+	done
 
 .PHONY: install
 install: check
@@ -41,6 +45,9 @@ install: check
 		$(MAKE) -C $$subdir $@; \
 	done
 	$(MAKE) ioemuinstall
+	@set -e; for subdir in $(POST_SUBDIRS-y); do \
+		$(MAKE) -C $$subdir $@; \
+	done
 	$(INSTALL_DIR) -p $(DESTDIR)/var/xen/dump
 	$(INSTALL_DIR) -p $(DESTDIR)/var/log/xen
 
@@ -50,6 +57,9 @@ clean: check_clean
 		$(MAKE) -C $$subdir $@; \
 	done
 	$(MAKE) ioemuclean
+	@set -e; for subdir in $(POST_SUBDIRS-y); do \
+		$(MAKE) -C $$subdir $@; \
+	done
 
 .PHONY: distclean
 distclean: clean

[-- Attachment #4: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 24+ messages in thread
* Re: [RFC] keymap support for PVFB
@ 2007-01-12 12:35 Bruce Rogers
  2007-01-12 13:32 ` Daniel P. Berrange
  0 siblings, 1 reply; 24+ messages in thread
From: Bruce Rogers @ 2007-01-12 12:35 UTC (permalink / raw)
  To: berrange, kraxel; +Cc: Xen-devel, ichino.junko, armbru

Correct me if I'm wrong, but I thought the default *was* to use relative
mouse coordinates.  And can you point me to Anthony's work?

- Thanks

>>> "Daniel P. Berrange" <berrange@redhat.com> 01/12/07 5:16 AM >>>
On Fri, Jan 12, 2007 at 09:15:21AM +0100, Gerd Hoffmann wrote:
>   Hi,
> 
> >> I've tried to tackle the same issue by hacking the vnc client side to
> >> send us keysyms no matter what the local keyboard mapping is.  So I can
> >> have any keyboard map loaded on the host, qemu-dm/vncfb sees us keysyms
> >> nevertheless and passes the correct scancodes to the guest OS.
> > 
> > You mean scan codes, don't you?  Key symbols are the XK_a and so
> > forth.
> 
> No, keysyms.  This is what the vnc protocol uses, so there is no way
> around that, unfortunaly.  It takes the X11 keycodes and translates
> these to us keymap keysyms using a buildin table, then sends them.  So
> for the server side (from vnc protocol view, i.e. qemu-dm or vnc-fb) it
> looks like a vnc client with us keyboard.
> 
> > Passing scan codes in addition to key symbols makes sense.
> 
> Does the vnc protocol allow that?  I don't think so :-(

No, but there's no reason we couldn't come up with an extension. Anthony
has already done similar to allow passing of relative mouse co-ords instead
of absolute co-ords. Extensions are opt-in, so unless the client has support
they'd carry on with normal keysyms, but a client that understood the new
extension could switch to scan codes. The important thing is talking to
upstream VNC mailing lists about any proposed extension to get buy-in so
some of the popular clients implement it. As far as i'm concerned, I'm more
than happy to extend the virt-manager  VNC client if it could enable better
internationalized keyboard handling.

Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2007-01-18 15:01 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-28  4:11 [RFC] keymap support for PVFB Junko Ichino
2006-12-28 16:02 ` Ewan Mellor
2007-01-09  0:56   ` Kasai Takanori
2007-01-09  1:07   ` Junko Ichino
2007-01-10 20:18 ` Markus Armbruster
2007-01-11  9:09   ` Gerd Hoffmann
2007-01-11 17:53     ` Markus Armbruster
2007-01-12  8:15       ` Gerd Hoffmann
2007-01-12 10:48         ` Markus Armbruster
2007-01-12 11:02           ` Gerd Hoffmann
2007-01-12 12:16         ` Daniel P. Berrange
2007-01-11 14:09   ` Junko Ichino
2007-01-11 17:54     ` Markus Armbruster
2007-01-17  6:07       ` Junko Ichino
2007-01-17  7:48         ` Markus Armbruster
2007-01-17  9:39           ` Junko Ichino
2007-01-17 10:21             ` Markus Armbruster
2007-01-17 11:39               ` Junko Ichino
2007-01-17 12:46                 ` Kasai Takanori
2007-01-17 13:25                 ` Markus Armbruster
2007-01-18 12:17                   ` Junko Ichino
2007-01-18 15:01                     ` Markus Armbruster
  -- strict thread matches above, loose matches on Subject: below --
2007-01-12 12:35 Bruce Rogers
2007-01-12 13:32 ` Daniel P. Berrange

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.