Support special keys VK_ABNT_C1 and VK_ABNT_C2 of Brazilian keyboard

RESOLVED FIXED in mozilla25

Status

()

Core
Widget: Win32
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: masayuki, Assigned: masayuki)

Tracking

({intl})

Trunk
mozilla25
x86_64
Windows 8
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

VK_ABNT_C1 is the right key of the left shift key which is a printable key.

VK_ABNT_C2 is separator key on numpad. KeyboardEvent.key supports this key by bug 865566, but we need more work for it.
Created attachment 779143 [details] [diff] [review]
part.1 Support VK_ABNT_C1 and VK_ABNT_C2 (keyCode and location)
Created attachment 779144 [details] [diff] [review]
part.2 Add tests for VK_ABNT_C1 and VK_ABNT_C2
Created attachment 779187 [details] [diff] [review]
part.1 Support VK_ABNT_C1 and VK_ABNT_C2 (keyCode and location)

This patch makes:

KeyboardEvent.location for VK_ABNT_C2 is DOM_LOCATION_NUMPAD.
KeyboardEvent.keyCode for VK_ABNT_C1 is computed from the input character.
KeyboardEvent.keyCode for VK_ABNT_C2 is NS_VK_SEPARATOR. IE uses 0xC2 (the raw value of VK_ABNT_C2). However, we're already using NS_VK_SEPARATOR for the key on Mac and Linux. Let's keep the consistency between Gecko on all platforms.
Attachment #779143 - Attachment is obsolete: true
Attachment #779187 - Flags: review?(jmathies)
Attachment #779187 - Flags: review?(bugs)
Comment on attachment 779144 [details] [diff] [review]
part.2 Add tests for VK_ABNT_C1 and VK_ABNT_C2

Note that only keydown and keyup events are fired at WIN_VK_ABNT_C2 with Japanese keyboard layout. This is a bug at least under our rules. I'll file a bug for it.
Attachment #779144 - Flags: review?(jmathies)
Attachment #779144 - Flags: review?(bugs)

Updated

5 years ago
Attachment #779144 - Flags: review?(jmathies) → review+

Comment 6

5 years ago
Comment on attachment 779187 [details] [diff] [review]
part.1 Support VK_ABNT_C1 and VK_ABNT_C2 (keyCode and location)

I don't have the ability to test, the code looks correct though afaict.
Attachment #779187 - Flags: review?(jmathies) → review+
You can test only VK_ABNT_C1, which can be pressed with screen keyboard of Windows. For testing VK_ABNT_C2, you need Brazilian full keyboard or JIS full keyboard for Mac.
(In reply to Masayuki Nakano (:masayuki) (Mozilla Japan) from comment #0)
> VK_ABNT_C1 is the right key of the left shift key which is a printable key.

Oops, the left key of the right shift key.
Comment on attachment 779187 [details] [diff] [review]
part.1 Support VK_ABNT_C1 and VK_ABNT_C2 (keyCode and location)

Do you know what Chrome or Safari reports for VK_ABNT_C2?
Attachment #779187 - Flags: review?(bugs) → review+
(In reply to Olli Pettay [:smaug] from comment #9)
> Comment on attachment 779187 [details] [diff] [review]
> part.1 Support VK_ABNT_C1 and VK_ABNT_C2 (keyCode and location)
> 
> Do you know what Chrome or Safari reports for VK_ABNT_C2?

Chrome uses 0xC2 on Windows but 0xBC on Mac.
Safari uses 0xBC.

And I check Gecko for Mac, Gecko for Mac uses DOM_VK_COMMA. I checked TextInputHandler.mm, then, I realized that I forgot to handle kVK_JIS_KeypadComma as a special key :-( I'll file a bug for it.
https://hg.mozilla.org/mozilla-central/rev/5baadcc1a4ca
https://hg.mozilla.org/mozilla-central/rev/28039c359ce8
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
Keywords: intl
You need to log in before you can comment on or make changes to this bug.