qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Hervé Poussineau" <hpoussin@reactos.org>
To: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: qemu-devel@nongnu.org, Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] ps2: Fix lost scancodes by recent changes
Date: Tue, 27 Dec 2016 15:27:27 +0100	[thread overview]
Message-ID: <f8044f23-52ef-89f8-5ca7-b27de2989cc7@reactos.org> (raw)
In-Reply-To: <87fuletg61.fsf@mail.parknet.co.jp>

Le 23/12/2016 à 23:49, OGAWA Hirofumi a écrit :
> Hi,
>
> Hervé Poussineau <hpoussin@reactos.org> 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	other threads:[~2016-12-27 14:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-23 13:00 [Qemu-devel] [PATCH] ps2: Fix lost scancodes by recent changes OGAWA Hirofumi
2016-12-23 20:58 ` Hervé Poussineau
2016-12-23 22:49   ` OGAWA Hirofumi
2016-12-27 14:27     ` Hervé Poussineau [this message]
2016-12-27 19:49       ` OGAWA Hirofumi
2016-12-27 19:55         ` [Qemu-devel] [PATCH v3] " OGAWA Hirofumi
2016-12-27 20:11           ` Hervé Poussineau
2017-01-04  8:50           ` Gerd Hoffmann
2017-01-04 17:59             ` Hervé Poussineau
2017-01-04 21:11               ` OGAWA Hirofumi
2017-01-05  8:12                 ` Gerd Hoffmann
2017-01-05  8:45                   ` OGAWA Hirofumi
2016-12-23 21:58 ` [Qemu-devel] [PATCH] " Eric Blake
2016-12-23 23:33   ` OGAWA Hirofumi
2016-12-23 23:36     ` [Qemu-devel] [PATCH v2] " OGAWA Hirofumi

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=f8044f23-52ef-89f8-5ca7-b27de2989cc7@reactos.org \
    --to=hpoussin@reactos.org \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=kraxel@redhat.com \
    --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).