This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 24740 - Define code values for the special keys on Mac keyboard
Summary: Define code values for the special keys on Mac keyboard
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - DOM3 Events (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Travis Leithead [MSFT]
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-20 03:22 UTC by Masayuki Nakano
Modified: 2014-04-15 18:07 UTC (History)
3 users (show)

See Also:


Attachments

Description Masayuki Nakano 2014-02-20 03:22:39 UTC
I tested on JIS keyboard for Mac.

Printed key name          USB Usage ID Page 0x07    Name in USB-HID spec
英数(Eisu)                 0x91                      LANG2
かな(Kana)                 0x92                      LANG1
F13 - F19                 0x68 - 0x6E               F13 - F19
Comment 1 Gary Kacmarcik 2014-03-05 00:10:39 UTC
For F13-F19, we cover that with the line after the table:

"For keyboards that provide more than 12 function keys, the code value follows the pattern shown above with 'F' followed by the function key number - 'F13', 'F14', 'F15', and so on."

We'll need to add a code for Eisu.

For Kana, can we not use 'KanaMode' for this? It looks like the USB code is different for KanaMode (0x88) and Kana (0x92).
Comment 2 Masayuki Nakano 2014-03-05 00:36:32 UTC
(In reply to Gary Kacmarcik from comment #1)
> We'll need to add a code for Eisu.
> 
> For Kana, can we not use 'KanaMode' for this? It looks like the USB code is
> different for KanaMode (0x88) and Kana (0x92).

Oops, I realized that 0x91 conflicts with key of Korean keyboard...

> 145 91 Keyboard LANG2 26
> 146 92 Keyboard LANG3 30

> 26 Hanja conversion key. This usage is used as an input method
>    editor control key on a Korean language keyboard. 
> 30 Defines the Katakana key for Japanese USB word-processing keyboards.

See also "List of code values for functional keys found on Japanese and Korean keyboards." of D3E spec.

So, it's might better D3E to define more abstract name form them.
Comment 3 Gary Kacmarcik 2014-04-07 21:06:46 UTC
I've added 'Eisu', 'Hiragana' and 'Katakana' |code| values so that these keys can be encoded when found on keyboards.

However, for the Mac 'かな' key, it sounds like this toggles between kana modes so 'KanaMode' would be more appropriate.

The 'Hiragana' and 'Katakana' key code values should be used for keys that always switch into hiragana or katakana mode rather that toggling between states.
Comment 4 Masayuki Nakano 2014-04-09 07:35:12 UTC
Hmm, when I connect Mac JIS keyboard, following keys conflict:
               Mac JIS keyboard           Korean keyboard           USB HID
ScanCode:71    Eisu (英数)                 Hanja (한자)               0x91
ScanCode:72    Kana (かな)                 HangulMode (한/영)         0x90

Sorry, I logged wrong value for Kana key.

I believe that these code values should be abstract names such as LANG1, LANG2 of USB HID spec.

> However, for the Mac 'かな' key, it sounds like this toggles between kana modes so 'KanaMode' would be more appropriate.

This sound like the concept of .key value. Doesn't .code represent physical keys?
Comment 5 Gary Kacmarcik 2014-04-15 18:07:46 UTC
> I believe that these code values should be abstract names such as LANG1, LANG2 of USB HID spec.

Yes, if different keys share the same values, then we should use the more generic Lang1 ... Lang5 names.

> This sound like the concept of .key value. Doesn't .code represent physical keys?

Yes, but I was (incorrectly) thinking that the key had only a single purpose, in which case the |key| and |code| values would be similar.  Since the Korean and Mac Japanese keyboards share the same USB code, they should share the same |code| values.

I've updated the code value tables with the new names and the additional information that you provided.

Thanks!