Bug 21139 - Define key name for Hankaku-Zenkaku key and Katakana-Hiragana key
Summary: Define key name for Hankaku-Zenkaku key and Katakana-Hiragana key
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: Gary Kacmarcik
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 21083
  Show dependency treegraph
 
Reported: 2013-02-27 06:34 UTC by Masayuki Nakano
Modified: 2013-08-01 09:02 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Masayuki Nakano 2013-02-27 06:34:04 UTC
D3E defines key names, "FullWidth" (for Zenkaku), "HalfWidth" (for Hankaku), "Katakana" and "Hiragana".

If the key actually sets the state to the named mode, it's okay. However, GTK, Qt and Android defines the keys as:

GTK                    Qt                         Android

GDK_Hiragana_Katakana  Qt::Key_Hiragana_Katakana  KEYCODE_KATAKANA_HIRAGANA
GDK_Zenkaku_Hankaku    Qt::Key_Zenkaku_Hankaku    KEYCODE_ZENKAKU_HANKAKU

Note that GTK and Qt also defines
GDK_Hiragana           Qt::Key_Hiragana
GDK_Katakana           Qt::Key_Katakana
GDK_Zenkaku            Qt::Key_Zenkaku
GDK_Hankaku            Qt::Key_Hankaku

So, if the former key code values are mapped, we cannot use the key names for latter key code values.

So, I think that 'ToggleFullWidthHalfWidth' or something and 'ToggleKatakanaHiragana' or something should be defined.
Comment 1 Gary Kacmarcik 2013-07-10 18:43:07 UTC
I've added:
* HiraganaKatakana
* ZenkakuHankaku

I'll also be removing:
* Hiragana
* Katakana
* FullWidth
* HalfWidth
unless these actually exist as separate keys. I've never seen them that way on a keyboard - they've always been a single key that toggles between the 2 states.
Comment 2 Masayuki Nakano 2013-07-14 17:20:58 UTC
(In reply to comment #1)
> I'll also be removing:
> * Hiragana
> * Katakana
> * FullWidth
> * HalfWidth
> unless these actually exist as separate keys. I've never seen them that way
> on a keyboard - they've always been a single key that toggles between the 2
> states.

That's too bad for Windows. On Windows, these keys are "hidden" lockable keys. There are no LEDs for them, but when user presses HalfWidth/FullWidth key, then, the current locked state key up message is dispatched and new locked state key down message is dispatched.

See this bug of Gecko:
https://bugzilla.mozilla.org/show_bug.cgi?id=865565
Comment 3 Masayuki Nakano 2013-07-14 17:29:21 UTC
For example, when I press Half Width / Full Width key multiple times, then, keyup event for HalfWith and keydown event for FullWidth are fired at (2n+1) time. And keyup event for FullWidth keyup event and keydown event for HalfWidth event are fired at (2n) time.

Unfortunately, Hiragana key and Katakana key are more complicated. They also behaves like HalfWidth or FullWidth key, but Alphanumeric key also causes keyup event for them.

So, implementing on Windows, these key names are necessary. However, on Linux and Android, they are not lockable key. Therefore, we need the key names which indicate toggle key.
Comment 4 Masayuki Nakano 2013-07-22 07:55:14 UTC
See new key mapping on Gecko 25 and later.

https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names_and_Char_values
# See VK_OEM_* in the table.
Comment 5 Gary Kacmarcik 2013-07-31 12:57:19 UTC
Fixed in latest ED.

All 6 keynames are defined:
* HiraganaKatakana
* ZenkakuHankaku
* Hiragana
* Katakana
* FullWidth
* HalfWidth
Comment 6 Masayuki Nakano 2013-08-01 09:02:30 UTC
Thank you, Gary.

However, is it OK "ZenkakuHankaku" vs. "FullWidth" and "HalfWidth"? Sounds odd for me.