Skip to contentSkip to conversation

ps2: Fix lost scancodes by recent changes

PATCH Superseded OGAWA Hirofumi 4 participants 15 messages Dec 23, 2016 – Jan 5, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ps2: Fix lost scancodes by recent changes

With "ps2: use QEMU qcodes instead of scancodes", key handling was changed to qcode base. But all scancodes are not converted to new one.

This adds some missing qcodes what I found in using.

---

 hw/input/ps2.c    |    3 +++
 qapi-schema.json  |    3 ++-
 ui/input-keymap.c |    3 +++
 3 files changed, 8 insertions(+), 1 deletion(-)
hw/input/ps2.c renamed from hw/input/ps2.c~fix-ps2-scancode +3 -0
diff -puN hw/input/ps2.c~fix-ps2-scancode hw/input/ps2.c
@@ -394,6 +394,9 @@ static const uint16_t qcode_to_keycode_s
     [Q_KEY_CODE_LESS] = 0x61,
     [Q_KEY_CODE_SYSRQ] = 0x7f,
     [Q_KEY_CODE_RO] = 0x51,
+    [Q_KEY_CODE_HIRAGANA] = 0x13,
+    [Q_KEY_CODE_HENKAN] = 0x64,
+    [Q_KEY_CODE_YEN] = 0x6a,
     [Q_KEY_CODE_KP_COMMA] = 0x6d,
 };
 
qapi-schema.json renamed from qapi-schema.json~fix-ps2-scancode +2 -1
diff -puN qapi-schema.json~fix-ps2-scancode qapi-schema.json
@@ -3642,7 +3642,8 @@
             'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
             'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
             'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
-            'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause', 'ro',
+            'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause',
+            'ro', 'hiragana', 'henkan', 'yen',
             'kp_comma', 'kp_equals', 'power' ] }
 
 ##
ui/input-keymap.c renamed from ui/input-keymap.c~fix-ps2-scancode +3 -0
diff -puN ui/input-keymap.c~fix-ps2-scancode ui/input-keymap.c
@@ -131,6 +131,9 @@ static const int qcode_to_number[] = {
     [Q_KEY_CODE_DELETE] = 0xd3,
 
     [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,

_

Signature · 1 line
OGAWA Hirofumi <[email protected]>
#1 lore raw
Quoted 44 lines · OGAWA Hirofumi

With "ps2: use QEMU qcodes instead of scancodes", key handling was changed to qcode base. But all scancodes are not converted to new one.

This adds some missing qcodes what I found in using.

---

 hw/input/ps2.c    |    3 +++
 qapi-schema.json  |    3 ++-
 ui/input-keymap.c |    3 +++
 3 files changed, 8 insertions(+), 1 deletion(-)

diff -puN hw/input/ps2.c~fix-ps2-scancode hw/input/ps2.c

hw/input/ps2.c renamed from hw/input/ps2.c~fix-ps2-scancode +3 -0
@@ -394,6 +394,9 @@ static const uint16_t qcode_to_keycode_s
     [Q_KEY_CODE_LESS] = 0x61,
     [Q_KEY_CODE_SYSRQ] = 0x7f,
     [Q_KEY_CODE_RO] = 0x51,
+    [Q_KEY_CODE_HIRAGANA] = 0x13,
+    [Q_KEY_CODE_HENKAN] = 0x64,
+    [Q_KEY_CODE_YEN] = 0x6a,
     [Q_KEY_CODE_KP_COMMA] = 0x6d,
 };
 

diff -puN qapi-schema.json~fix-ps2-scancode qapi-schema.json

qapi-schema.json renamed from qapi-schema.json~fix-ps2-scancode +2 -1
@@ -3642,7 +3642,8 @@
             'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
             'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
             'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
-            'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause', 'ro',
+            'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause',
+            'ro', 'hiragana', 'henkan', 'yen',
             'kp_comma', 'kp_equals', 'power' ] }
 
 ##

diff -puN ui/input-keymap.c~fix-ps2-scancode ui/input-keymap.c

ui/input-keymap.c static const int qcode_to_number[] = { · line 139

Quoted 9 lines
ui/input-keymap.c renamed from ui/input-keymap.c~fix-ps2-scancode +3 -0
@@ -131,6 +131,9 @@ static const int qcode_to_number[] = {
     [Q_KEY_CODE_DELETE] = 0xd3,
 
     [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,

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,

and scancode set 3:

+    [Q_KEY_CODE_HIRAGANA] = 0x87,
+    [Q_KEY_CODE_HENKAN] = 0x86,
+    [Q_KEY_CODE_YEN] = 0x51,

Hervé

#2 lore raw

Hi,

ui/input-keymap.c static const int qcode_to_number[] = { · line 136

Quoted 12 lines · Hervé Poussineau

ui/input-keymap.c static const int qcode_to_number[] = { · line 139

Quoted 7 lines
     [Q_KEY_CODE_RO] = 0x73,
ui/input-keymap.c renamed from ui/input-keymap.c~fix-ps2-scancode +3 -0
+    [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,

Can you also add the keycodes for scancode set 1:

ui/input-keymap.c renamed from ui/input-keymap.c~fix-ps2-scancode +3 -0
+    [Q_KEY_CODE_HIRAGANA] = 0x70,
+    [Q_KEY_CODE_HENKAN] = 0x79,
+    [Q_KEY_CODE_YEN] = 0x7d,

Current linux can't use set1, so untested.

Review

Quoted 4 lines

and scancode set 3:

(quoted diff) +3 -0
+    [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 06:49:58.149812: EV_KEY KEY_HENKAN (0x5c) released 06:49:58.149812: EV_SYN code=0 value=0 06:49:58.333876: EV_MSC MSC_SCAN 135
[... on qemu monitor "sendkey hiragana" ...] 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 06:49:58.893893: EV_MSC MSC_SCAN 81
[... on qemu monitor "sendkey yen" ...] 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

Signature · 1 line
OGAWA Hirofumi <[email protected]>
#3 lore raw
Quoted 4 lines · OGAWA Hirofumi

Hi,

Hervé Poussineau <[email protected]> writes:

[from ui/input-keymap.c]

Quoted 8 lines
Quoted 8 lines

ui/input-keymap.c static const int qcode_to_number[] = { · line 139

Quoted 7 lines
     [Q_KEY_CODE_RO] = 0x73,
ui/input-keymap.c renamed from ui/input-keymap.c~fix-ps2-scancode +3 -0
+    [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]

Quoted 6 lines

ui/input-keymap.c static const int qcode_to_number[] = { · line 136

Quoted 4 lines

Can you also add the keycodes for scancode set 1:

ui/input-keymap.c renamed from ui/input-keymap.c~fix-ps2-scancode +3 -0
+    [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

Quoted 40 lines

Review

Quoted 5 lines

and scancode set 3:

(quoted diff) +3 -0
+    [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
Quoted 5 lines

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)

Quoted 5 lines

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)

Quoted 8 lines

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

Quoted 6 lines

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é

#4 lore raw
Quoted 9 lines · Hervé Poussineau

[from hw/input/ps2.c]

Quoted 6 lines

ui/input-keymap.c static const int qcode_to_number[] = { · line 136

Quoted 4 lines

Can you also add the keycodes for scancode set 1:

ui/input-keymap.c renamed from ui/input-keymap.c~fix-ps2-scancode +3 -0
+    [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

I see.

Quoted 19 lines
Quoted 2 lines

[... on qemu monitor "sendkey yen" ...]
06:49:58.893893: EV_MSC MSC_SCAN 81

-> 81 = 0x51

Quoted 6 lines

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:

[...]

Quoted 6 lines

Set 3:

(quoted diff) +3 -0
+    [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?

04:32:33.111316: EV_MSC MSC_SCAN 93 04:32:33.111316: EV_KEY KEY_BACKSLASH (0x2b) pressed 04:32:33.111316: EV_SYN code=0 value=0

Sent 93==0x5d as expected, but keycode is BACKSLASH. Of course, linux driver is using BACKSLASH(43) keycode for 0x5d. But linux driver has several BACKSLASH entries for multiple scancodes in set3.

And qemu doesn't have 0x5d entry in set3. Also

	http://hp.vector.co.jp/authors/VA003720/lpproj/others/kbdjpn.htm

yet another site says 0x5d.

Some sites says about buggy keyboards using wrong scancode in set3, and microsoft seems to removed set3 from specification. So linux translation table for 43=>0x5d, maybe result of workarounds.

So looks like 0x5d is right value for set3.

Thanks.

Signature · 1 line
OGAWA Hirofumi <[email protected]>
#5 lore raw

PATCH v3 1/1 ps2: Fix lost scancodes by recent changes

With "ps2: use QEMU qcodes instead of scancodes", key handling was changed to qcode base. But all scancodes are not converted to new one.

This adds some missing qcodes/scancodes what I found in using.

[set1 and set3 are from <[email protected]>]

---

 hw/input/ps2.c    |   10 ++++++++++
 qapi-schema.json  |    6 +++++-
 ui/input-keymap.c |    3 +++
 3 files changed, 18 insertions(+), 1 deletion(-)
hw/input/ps2.c renamed from hw/input/ps2.c~fix-ps2-scancode +10 -0
diff -puN hw/input/ps2.c~fix-ps2-scancode hw/input/ps2.c
@@ -252,6 +252,9 @@ static const uint16_t qcode_to_keycode_s
     [Q_KEY_CODE_ASTERISK] = 0x37,
     [Q_KEY_CODE_LESS] = 0x56,
     [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,
 };
 
@@ -394,6 +397,9 @@ static const uint16_t qcode_to_keycode_s
     [Q_KEY_CODE_LESS] = 0x61,
     [Q_KEY_CODE_SYSRQ] = 0x7f,
     [Q_KEY_CODE_RO] = 0x51,
+    [Q_KEY_CODE_HIRAGANA] = 0x13,
+    [Q_KEY_CODE_HENKAN] = 0x64,
+    [Q_KEY_CODE_YEN] = 0x6a,
     [Q_KEY_CODE_KP_COMMA] = 0x6d,
 };
 
@@ -504,6 +510,10 @@ static const uint16_t qcode_to_keycode_s
     [Q_KEY_CODE_COMMA] = 0x41,
     [Q_KEY_CODE_DOT] = 0x49,
     [Q_KEY_CODE_SLASH] = 0x4a,
+
+    [Q_KEY_CODE_HIRAGANA] = 0x87,
+    [Q_KEY_CODE_HENKAN] = 0x86,
+    [Q_KEY_CODE_YEN] = 0x5d,
 };
 
 static uint8_t translate_table[256] = {
qapi-schema.json renamed from qapi-schema.json~fix-ps2-scancode +5 -1
diff -puN qapi-schema.json~fix-ps2-scancode qapi-schema.json
@@ -3618,6 +3618,9 @@
 # @kp_comma: since 2.4
 # @kp_equals: since 2.6
 # @power: since 2.6
+# @hiragana: since 2.9
+# @henkan: since 2.9
+# @yen: since 2.9
 #
 # An enumeration of key name.
 #
@@ -3642,7 +3645,8 @@
             'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
             'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
             'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
-            'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause', 'ro',
+            'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause',
+            'ro', 'hiragana', 'henkan', 'yen',
             'kp_comma', 'kp_equals', 'power' ] }
 
 ##
ui/input-keymap.c renamed from ui/input-keymap.c~fix-ps2-scancode +3 -0
diff -puN ui/input-keymap.c~fix-ps2-scancode ui/input-keymap.c
@@ -131,6 +131,9 @@ static const int qcode_to_number[] = {
     [Q_KEY_CODE_DELETE] = 0xd3,
 
     [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,

_

Signature · 1 line
OGAWA Hirofumi <[email protected]>
#7 lore raw
In reply to OGAWA Hirofumi
Quoted 4 lines · OGAWA Hirofumi

With "ps2: use QEMU qcodes instead of scancodes", key handling was changed to qcode base. But all scancodes are not converted to new one.

This adds some missing qcodes/scancodes what I found in using.

Added to ui queue.

thanks,
Gerd

#8 lore raw
Quoted 7 lines · Gerd Hoffmann
Quoted 4 lines · OGAWA Hirofumi

With "ps2: use QEMU qcodes instead of scancodes", key handling was changed to qcode base. But all scancodes are not converted to new one.

This adds some missing qcodes/scancodes what I found in using.

Added to ui queue.

Hi Gerd,

Your pull request (patch 01/11) contains v2 of this patch (which is incomplete). I've only reviewed v3, which is complete.

Regards,

Hervé

author Reviewed-by Hervé Poussineau
#9 lore raw
Quoted 5 lines · Hervé Poussineau
Quoted 4 lines · Gerd Hoffmann
Quoted 3 lines · OGAWA Hirofumi

With "ps2: use QEMU qcodes instead of scancodes", key handling was changed to qcode base. But all scancodes are not converted to new one.

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

This adds some missing qcodes/scancodes what I found in using.

Added to ui queue.

Hi Gerd,

Your pull request (patch 01/11) contains v2 of this patch (which is incomplete). I've only reviewed v3, which is complete.

Yes, please use v3. Here is copy&paste, FWIW.

----
Subject: [PATCH v3] ps2: Fix lost scancodes by recent changes

With "ps2: use QEMU qcodes instead of scancodes", key handling was changed to qcode base. But all scancodes are not converted to new one.

This adds some missing qcodes/scancodes what I found in using.

[set1 and set3 are from Hervé Poussineau <[email protected]>]

---

 hw/input/ps2.c    |   10 ++++++++++
 qapi-schema.json  |    6 +++++-
 ui/input-keymap.c |    3 +++
 3 files changed, 18 insertions(+), 1 deletion(-)
hw/input/ps2.c renamed from hw/input/ps2.c~fix-ps2-scancode +10 -0
diff -puN hw/input/ps2.c~fix-ps2-scancode hw/input/ps2.c
@@ -252,6 +252,9 @@ static const uint16_t qcode_to_keycode_s
     [Q_KEY_CODE_ASTERISK] = 0x37,
     [Q_KEY_CODE_LESS] = 0x56,
     [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,
 };
 
@@ -394,6 +397,9 @@ static const uint16_t qcode_to_keycode_s
     [Q_KEY_CODE_LESS] = 0x61,
     [Q_KEY_CODE_SYSRQ] = 0x7f,
     [Q_KEY_CODE_RO] = 0x51,
+    [Q_KEY_CODE_HIRAGANA] = 0x13,
+    [Q_KEY_CODE_HENKAN] = 0x64,
+    [Q_KEY_CODE_YEN] = 0x6a,
     [Q_KEY_CODE_KP_COMMA] = 0x6d,
 };
 
@@ -504,6 +510,10 @@ static const uint16_t qcode_to_keycode_s
     [Q_KEY_CODE_COMMA] = 0x41,
     [Q_KEY_CODE_DOT] = 0x49,
     [Q_KEY_CODE_SLASH] = 0x4a,
+
+    [Q_KEY_CODE_HIRAGANA] = 0x87,
+    [Q_KEY_CODE_HENKAN] = 0x86,
+    [Q_KEY_CODE_YEN] = 0x5d,
 };
 
 static uint8_t translate_table[256] = {
qapi-schema.json renamed from qapi-schema.json~fix-ps2-scancode +5 -1
diff -puN qapi-schema.json~fix-ps2-scancode qapi-schema.json
@@ -3618,6 +3618,9 @@
 # @kp_comma: since 2.4
 # @kp_equals: since 2.6
 # @power: since 2.6
+# @hiragana: since 2.9
+# @henkan: since 2.9
+# @yen: since 2.9
 #
 # An enumeration of key name.
 #
@@ -3642,7 +3645,8 @@
             'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
             'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
             'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
-            'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause', 'ro',
+            'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause',
+            'ro', 'hiragana', 'henkan', 'yen',
             'kp_comma', 'kp_equals', 'power' ] }
 
 ##
ui/input-keymap.c renamed from ui/input-keymap.c~fix-ps2-scancode +3 -0
diff -puN ui/input-keymap.c~fix-ps2-scancode ui/input-keymap.c
@@ -131,6 +131,9 @@ static const int qcode_to_number[] = {
     [Q_KEY_CODE_DELETE] = 0xd3,
 
     [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,

_

Signature · 1 line
OGAWA Hirofumi <[email protected]>
#10 lore raw
Quoted 9 lines · OGAWA Hirofumi
Quoted 7 lines · Hervé Poussineau
Quoted 6 lines · Gerd Hoffmann
Quoted 4 lines · OGAWA Hirofumi

With "ps2: use QEMU qcodes instead of scancodes", key handling was changed to qcode base. But all scancodes are not converted to new one.

This adds some missing qcodes/scancodes what I found in using.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Added to ui queue.

Hi Gerd,

Your pull request (patch 01/11) contains v2 of this patch (which is incomplete). I've only reviewed v3, which is complete.

Yes, please use v3. Here is copy&paste, FWIW.

Please don't send new versions of patches as reply. That confuses various patch management tools, they are considered being part of the discussion then. This is how the reviewed-by tag ended up being attributed to the wrong patch version.

Have a look at http://patchew.org/QEMU/ for example, the patches sent as reply don't show up there, so they are not tested automatically.

thanks,
Gerd

#11 lore raw
Quoted 9 lines · Gerd Hoffmann
Quoted 1 line

Yes, please use v3. Here is copy&paste, FWIW.

Please don't send new versions of patches as reply. That confuses various patch management tools, they are considered being part of the discussion then. This is how the reviewed-by tag ended up being attributed to the wrong patch version.

Have a look at http://patchew.org/QEMU/ for example, the patches sent as reply don't show up there, so they are not tested automatically.

Hm, it is surprise to me. Ok, I will re-start on new thread for qemu-devel next time. BTW, url of your example didn't show even initial patch (if I didn't overlook). Looks like it is broken.

Thanks.

Signature · 1 line
OGAWA Hirofumi <[email protected]>
#12 lore raw
In reply to OGAWA Hirofumi
Quoted 12 lines · OGAWA Hirofumi

With "ps2: use QEMU qcodes instead of scancodes", key handling was changed to qcode base. But all scancodes are not converted to new one.

This adds some missing qcodes what I found in using.

---

+++ qemu-hirofumi/qapi-schema.json 2016-12-23 21:14:59.840729469 +0900

qapi-schema.json line 3647

Quoted 7 lines
qapi-schema.json renamed from qapi-schema.json~fix-ps2-scancode +2 -1
@@ -3642,7 +3642,8 @@
             'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
             'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
             'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
-            'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause', 'ro',
+            'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause',
+            'ro', 'hiragana', 'henkan', 'yen',
             'kp_comma', 'kp_equals', 'power' ] }

Missing documentation (including a 'since 2.9' designation) for the new enum members.

Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
#13 lore raw
Quoted 11 lines · Eric Blake
Quoted 9 lines · OGAWA Hirofumi

With "ps2: use QEMU qcodes instead of scancodes", key handling was changed to qcode base. But all scancodes are not converted to new one.

This adds some missing qcodes what I found in using.

---

Quoted 12 lines

qapi-schema.json line 3647

Quoted 9 lines

+++ qemu-hirofumi/qapi-schema.json 2016-12-23 21:14:59.840729469 +0900

qapi-schema.json renamed from qapi-schema.json~fix-ps2-scancode +2 -1
@@ -3642,7 +3642,8 @@
             'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
             'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
             'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
-            'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause', 'ro',
+            'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause',
+            'ro', 'hiragana', 'henkan', 'yen',
             'kp_comma', 'kp_equals', 'power' ] }

Missing documentation (including a 'since 2.9' designation) for the new enum members.

Thanks for pointing out.

Signature · 1 line
OGAWA Hirofumi <[email protected]>
#14 lore raw

PATCH v2 1/1 ps2: Fix lost scancodes by recent changes

With "ps2: use QEMU qcodes instead of scancodes", key handling was changed to qcode base. But all scancodes are not converted to new one.

This adds some missing qcodes/scancodes what I found in using.

[set1 and set2 are still missing, but I'm not sure what is right values yet.]

---

 hw/input/ps2.c    |    3 +++
 qapi-schema.json  |    6 +++++-
 ui/input-keymap.c |    3 +++
 3 files changed, 11 insertions(+), 1 deletion(-)
hw/input/ps2.c renamed from hw/input/ps2.c~fix-ps2-scancode +3 -0
diff -puN hw/input/ps2.c~fix-ps2-scancode hw/input/ps2.c
@@ -394,6 +394,9 @@ static const uint16_t qcode_to_keycode_s
     [Q_KEY_CODE_LESS] = 0x61,
     [Q_KEY_CODE_SYSRQ] = 0x7f,
     [Q_KEY_CODE_RO] = 0x51,
+    [Q_KEY_CODE_HIRAGANA] = 0x13,
+    [Q_KEY_CODE_HENKAN] = 0x64,
+    [Q_KEY_CODE_YEN] = 0x6a,
     [Q_KEY_CODE_KP_COMMA] = 0x6d,
 };
 
qapi-schema.json renamed from qapi-schema.json~fix-ps2-scancode +5 -1
diff -puN qapi-schema.json~fix-ps2-scancode qapi-schema.json
@@ -3618,6 +3618,9 @@
 # @kp_comma: since 2.4
 # @kp_equals: since 2.6
 # @power: since 2.6
+# @hiragana: since 2.9
+# @henkan: since 2.9
+# @yen: since 2.9
 #
 # An enumeration of key name.
 #
@@ -3642,7 +3645,8 @@
             'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
             'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
             'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
-            'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause', 'ro',
+            'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause',
+            'ro', 'hiragana', 'henkan', 'yen',
             'kp_comma', 'kp_equals', 'power' ] }
 
 ##
ui/input-keymap.c renamed from ui/input-keymap.c~fix-ps2-scancode +3 -0
diff -puN ui/input-keymap.c~fix-ps2-scancode ui/input-keymap.c
@@ -131,6 +131,9 @@ static const int qcode_to_number[] = {
     [Q_KEY_CODE_DELETE] = 0xd3,
 
     [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,

_

Signature · 1 line
OGAWA Hirofumi <[email protected]>