From: "Kazu" <kazoo@r3.dion.ne.jp>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] Japanese keyboard
Date: Wed, 15 Mar 2006 15:44:31 +0900 [thread overview]
Message-ID: <002401c647fb$ea746da0$0464a8c0@athlon> (raw)
[-- Attachment #1: Type: text/plain, Size: 160 bytes --]
Hi,
Attached is a patch for Japanese keyboard. It is for X Window on Linux.
I tested it on Fedora Core 4 host. It has a workaround for SDL bug.
Regards,
kazu
[-- Attachment #2: qemu-20060226-keyboard.patch --]
[-- Type: application/octet-stream, Size: 2837 bytes --]
Index: sdl.c
===================================================================
RCS file: /sources/qemu/qemu/sdl.c,v
retrieving revision 1.23
diff -u -r1.23 sdl.c
--- sdl.c 30 Oct 2005 23:19:10 -0000 1.23
+++ sdl.c 26 Feb 2006 07:14:30 -0000
@@ -92,6 +92,10 @@
keysym = ev->keysym.sym;
if (keysym == 0 && ev->keysym.scancode == 113)
keysym = SDLK_MODE;
+ /* For Japanese key '\' and '|' */
+ if (keysym == 92 && ev->keysym.scancode == 133) {
+ keysym = 0xa5;
+ }
return keysym2scancode(kbd_layout, keysym);
}
@@ -106,7 +110,7 @@
#else
-static const uint8_t x_keycode_to_pc_keycode[61] = {
+static const uint8_t x_keycode_to_pc_keycode[115] = {
0xc7, /* 97 Home */
0xc8, /* 98 Up */
0xc9, /* 99 PgUp */
@@ -130,10 +134,10 @@
0x0, /* 117 */
0x0, /* 118 */
0x0, /* 119 */
- 0x70, /* 120 Hiragana_Katakana */
+ 0x0, /* 120 */
0x0, /* 121 */
0x0, /* 122 */
- 0x73, /* 123 backslash */
+ 0x0, /* 123 */
0x0, /* 124 */
0x0, /* 125 */
0x0, /* 126 */
@@ -168,6 +172,24 @@
0x51, /* 155 KP_PgDn */
0x52, /* 156 KP_Ins */
0x53, /* 157 KP_Del */
+ 0x0, /* 158 */
+ 0x0, /* 159 */
+ 0x0, /* 160 */
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, /* 170 */
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, /* 180 */
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, /* 190 */
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, /* 200 */
+ 0x0, /* 201 */
+ 0x0, /* 202 */
+ 0x0, /* 203 */
+ 0x0, /* 204 */
+ 0x0, /* 205 */
+ 0x0, /* 206 */
+ 0x0, /* 207 */
+ 0x70, /* 208 Hiragana_Katakana */
+ 0x0, /* 209 */
+ 0x0, /* 210 */
+ 0x73, /* 211 backslash */
};
static uint8_t sdl_keyevent_to_keycode(const SDL_KeyboardEvent *ev)
@@ -180,7 +202,7 @@
keycode = 0;
} else if (keycode < 97) {
keycode -= 8; /* just an offset */
- } else if (keycode < 158) {
+ } else if (keycode < 212) {
/* use conversion table */
keycode = x_keycode_to_pc_keycode[keycode - 97];
} else {
Index: keymaps/ja
===================================================================
RCS file: /sources/qemu/qemu/keymaps/ja,v
retrieving revision 1.1
diff -u -r1.1 ja
--- keymaps/ja 12 Dec 2004 16:56:30 -0000 1.1
+++ keymaps/ja 26 Feb 2006 07:14:30 -0000
@@ -97,6 +97,7 @@
Execute 0x54 shift
Kanji 0x70
backslash 0x73
+yen 0x7d
bar 0x7d shift
underscore 0x73 shift
Henkan_Mode 0x79
reply other threads:[~2006-03-15 6:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='002401c647fb$ea746da0$0464a8c0@athlon' \
--to=kazoo@r3.dion.ne.jp \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).