qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] ps2: Fix lost scancodes by recent changes


From: Hervé Poussineau
Subject: Re: [Qemu-devel] [PATCH] ps2: Fix lost scancodes by recent changes
Date: Tue, 27 Dec 2016 15:27:27 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.5.1

Le 23/12/2016 à 23:49, OGAWA Hirofumi a écrit :
Hi,

Hervé Poussineau <address@hidden> writes:

[from ui/input-keymap.c]
     [Q_KEY_CODE_RO] = 0x73,
+    [Q_KEY_CODE_HIRAGANA] = 0x70,
+    [Q_KEY_CODE_HENKAN] = 0x79,
+    [Q_KEY_CODE_YEN] = 0x7d,
     [Q_KEY_CODE_KP_COMMA] = 0x7e,

     [Q_KEY_CODE__MAX] = 0,


[from hw/input/ps2.c]
Can you also add the keycodes for scancode set 1:
+    [Q_KEY_CODE_HIRAGANA] = 0x70,
+    [Q_KEY_CODE_HENKAN] = 0x79,
+    [Q_KEY_CODE_YEN] = 0x7d,

Current linux can't use set1, so untested.

Note that those are the same as those added in input-keymap.c


and scancode set 3:
+    [Q_KEY_CODE_HIRAGANA] = 0x87,
+    [Q_KEY_CODE_HENKAN] = 0x86,
+    [Q_KEY_CODE_YEN] = 0x51,

Boot with "i8042.direct=1", then set set3.

# echo 3 > /sys/devices/platform/i8042/serio0/set
# cat /sys/devices/platform/i8042/serio0/set
3

HENKAN, HIRAGANA seems to be working, but YEN is not working.  I'm not
sure if it is your patch, testing, or kernel problem.

Can you point what is problem?

# lsinput

[...]

/dev/input/event4
   bustype : BUS_I8042
   vendor  : 0x1
   product : 0x3
   version : 43907
   name    : "AT Raw Set 3 keyboard"
   phys    : "isa0060/serio0/input0"
   bits ev : EV_SYN EV_KEY EV_MSC EV_LED EV_REP

# input-event
/dev/input/event4
   bustype : BUS_I8042
   vendor  : 0x1
   product : 0x3
   version : 43907
   name    : "AT Raw Set 3 keyboard"
   phys    : "isa0060/serio0/input0"
   bits ev : EV_SYN EV_KEY EV_MSC EV_LED EV_REP

waiting for events
[... on qemu monitor "sendkey henkan" ...]
06:49:58.061932: EV_KEY KEY_HENKAN (0x5c) pressed
06:49:58.061932: EV_SYN code=0 value=0
06:49:58.149812: EV_MSC MSC_SCAN 134
-> 134 = 0x86, as expected ([Q_KEY_CODE_HENKAN] = 0x86)

06:49:58.149812: EV_KEY KEY_HENKAN (0x5c) released
06:49:58.149812: EV_SYN code=0 value=0

[... on qemu monitor "sendkey hiragana" ...]
06:49:58.333876: EV_MSC MSC_SCAN 135
-> 135 = 0x87, as expected ([Q_KEY_CODE_HIRAGANA] = 0x87)

06:49:58.333876: EV_KEY KEY_KATAKANAHIRAGANA (0x5d) pressed
06:49:58.333876: EV_SYN code=0 value=0
06:49:58.421889: EV_MSC MSC_SCAN 135
06:49:58.421889: EV_KEY KEY_KATAKANAHIRAGANA (0x5d) released
06:49:58.421889: EV_SYN code=0 value=0

[... on qemu monitor "sendkey yen" ...]
06:49:58.893893: EV_MSC MSC_SCAN 81
-> 81 = 0x51
06:49:58.893893: EV_KEY KEY_VOLUMEDOWN (0x72) pressed
06:49:58.893893: EV_SYN code=0 value=0
06:49:58.973841: EV_MSC MSC_SCAN 81
06:49:58.973841: EV_KEY KEY_VOLUMEDOWN (0x72) released
06:49:58.973841: EV_SYN code=0 value=0
timeout, quitting

So, Linux is describing 0x51 make scancode as VOLUMEDOWN.

Indeed, according to http://www.quadibloc.com/comp/scan.htm
                Set 1  Set 2  Set 3
HENKAN           79     64     86    (kanji)
HIRAGANA         70     13     87    (katakana)
YEN              7d     6a     5d    (INT 4)

So correct values for hw/input/ps2.c seem to be:

Set 1 (same values as in ui/input-keymap.c)
+    [Q_KEY_CODE_HIRAGANA] = 0x70,
+    [Q_KEY_CODE_HENKAN] = 0x79,
+    [Q_KEY_CODE_YEN] = 0x7d,

Set 2 (your initial patch)
+    [Q_KEY_CODE_HIRAGANA] = 0x13,
+    [Q_KEY_CODE_HENKAN] = 0x64,
+    [Q_KEY_CODE_YEN] = 0x6a,

Set 3:
+    [Q_KEY_CODE_HIRAGANA] = 0x87, // already verified
+    [Q_KEY_CODE_HENKAN] = 0x86, // already verified
+    [Q_KEY_CODE_YEN] = 0x5d,  // not 0x51,  as I said in a previous email

Can you check those values?

Regards,

Hervé



reply via email to

[Prev in Thread] Current Thread [Next in Thread]