PC Japanese Keyboards


Overview

This article introduces basic knowledge about Japanese keyboards, especially the PC/AT 106/109 keyboard. It is intended for foreign users and developers to understand basic characteristics of Japanese keyboards and promote Japanese keyboard support. The main topics are keyboard layout and scancodes; note that Japanese input method is out of scope.

There have been so many keyboard layouts in Japan, including the ones of old 8-bit and 16-bit proprietary PCs, IBM PC/AT compatibles, Macintoshes, UNIX workstations etc. Most of them, however, are based on the Japanese Industrial Standard (JIS) and share the similar layout about alphabet, numerals, symbols and kana (Japanese syllabic characters). Thus standard Japanese keyboards are often called JIS layout keyboards. Although there are a few non-JIS layout Japanese keyboards (which are specially designed for efficient Japanese typing as the Dvorak layout for English typing), this article discusses only standard, JIS layout Japanese keyboards. Refer to "CJKV Information Processing" for details about non-JIS Japanese keyboards.

When you buy a PC in Japan, a Japanese keyboard will be bundled unless you order otherwise (which is usually impossible for big-name manufacturers). Average Japanese PC users use Japanese keyboards, while some people (PC addicts, UNIX wizards etc.) prefer US keyboards.


Japanese Keyboard Basics

To see the basic characteristics of the JIS layout, here we use a fictitious keyboard product as an example (because actual Japanese keyboard products have some quirks in its layout as described later and are not appropriate as the first example).

┌────┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬────┐
│    │ ! │ ” │ # │ $ │ % │ & │ ’ │ ( │ ) │   │ = │  ̄ │ | │    │
│Esc │1  │2  │3 ぁ│4 ぅ│5 ぇ│6 ぉ│7 ゃ│8 ゅ│9 ょ│0 を│−  │^  │¥  │ BS │
│    │ ぬ │ ふ │ あ │ う │ え │ お │ や │ ゆ │ よ │ わ │ ほ │ へ │ ー │    │
├────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┤
│      │   │   │   │   │   │   │   │   │   │   │ ` │ { │      │
│ Tab  │Q  │W  │E  │R  │T  │Y  │U  │I  │O  │P  │@  │[ 「│ Enter│
│      │ た │ て │ い │ す │ か │ ん │ な │ に │ ら │ せ │ ゛ │ ゜ │      │
├──────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐   │ │
│       │   │   │   │   │   │   │   │   │   │ + │ * │ } │  ←┘ │
│ Ctrl  │A  │S  │D  │F  │G  │H  │J  │K  │L  │;  │:  │] 」│     │
│       │ ち │ と │ し │ は │ き │ く │ ま │ の │ り │ れ │ け │ む │     │
├───────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─────┤
│         │   │   │   │   │   │   │   │ < │ > │ ? │ _ │       │
│  Shift  │Z っ│X  │C  │V  │B  │N  │M  │, 、│. 。│/ ・│   │ Shift │
│         │ つ │ さ │ そ │ ひ │ こ │ み │ も │ ね │ る │ め │ ろ │       │
└─────┬───┴─┬─┴───┼───┴───┴───┴───┴───┴───┴───┼───┴─┬─┴───────┘
      │     │     │                           │     │
      │Caps │ Alt │                           │ かな  │
      │     │     │                           │     │
      └─────┴─────┴───────────────────────────┴─────┘

Special keys are not of our interest here, so watch the generic ("white") keys. As you see, main differences from the US layout are:

Up to 4 characters are assigned to a single key. On the keytops they are shown as below:

You can input kana characters in kana mode. Press the Kana key (right of the space key) and you can toggle between Alphanumeric mode and Kana mode.

Before explaining the layout of symbols, we have to learn something about character codes. The Japanese variant of ISO 646 (i.e. ASCII) is defined in the Japanese Standard JIS X 0201. The Latin alphabet part of JIS X 0201 is similar to ASCII except these two:

Thus JIS layout keyboards have yen mark and overline but no backslash and tilde.

Well, now we will examine the layout of symbols. Some symbols are same as in the US layout, but many are different. This layout is based on ISO 9995 and you may find an outstanding principle: the keycodes of a single key always differ by 0x10 or 0x20 between in normal mode and in shift mode.

normal mode shift mode difference
0 (0x30) N/A N/A
2 (0x32) " (0x22) 0x10
6 (0x36) & (0x26) 0x10
9 (0x39) ) (0x29) 0x10
- (0x2D) = (0x3D) 0x10
: (0x3A) * (0x2A) 0x10
; (0x3B) + (0x2B) 0x10
@ (0x40) ` (0x60) 0x20
yen (0x5C) | (0x7C) 0x20
^ (0x5E) overline (0x7E) 0x20
N/A _ (0x5F) N/A

The shift mode of 0 (0x30) is supposed to be space (0x20), but it is unnecessary and is not assigned. Similarly, the normal mode of underscore (0x5F) may be DEL (0x7F), but it is a control code and is not assigned either. (You need the shift key to input underscore; this is pretty queer in JIS layout.)

Additionally, note that all keys that are necessary to input control codes, except underscore (0x5F), are assigned to normal mode. Thus you can input some control codes more straightforward than in the US layout:

Control code US layout Japanese layout
0x00 Ctrl + 2 Ctrl + @ (0x40)
0x1E Ctrl + 6 Ctrl + ^ (0x5E)
0x1F Ctrl + - Ctrl + _ (0x5F)

It's so logical isn't it? :-)


PC/AT 106/109 Japanese Keyboard

Now you have learned the basic characteristics of the JIS layout. Here we discuss the actual Japanese keyboards. There are some variants of Japanese keyboards for PC/AT and PS/2.

Of these layouts IBM 5576-A01 is currently widespread and regarded as the "standard" Japanese keyboard, while the others are very rare now. Thus this article focuses mainly on this layout. For other layouts refer to Keyboard Collection.

The IBM 5576-A01 and compatible keyboards are commonly called 106 Japanese keyboards since they have 106 keys. Recently three Microsoft-defined keys were added and the number increased to 109 keys.

Comparing it with the US layout and the JIS layout mentioned above, you may notice:

┬───┬───┬───┬───┬────┐
│〜 を│= £│ ̄ 々│| ¬│    │
│   │   │   │   │ BS │
│0 わ│− ほ│^ へ│¥ ー│    │
┴─┬─┴─┬─┴─┬─┴─┬─┴────┤
  │P 『│` ¢│{ 「│      │
  │   │   │   │ Enter│
  │  せ│@ ゛│[ ゜│      │
  ┴┬──┴┬──┴┬──┴┐   │ │
   │+ 』│* ヶ│} 」│  ←┘ │
   │   │   │   │     │
   │; れ│: け│] む│     │
   ┴─┬─┴─┬─┴─┬─┴─────┤
         │_ |│       │
         │   │ Shift │
         │\ ろ│       │
       ──┴───┴───────┘

It is confusing that backslash and tilde are printed as well as yen mark and overline.


Japanese Keyboard Scancodes

This section is meant for hardware/software engineers.

Basically, the scancodes of the Japanese 106/109 keyboard are same as the ones that keys in the corresponding positions in the 101 US keyboard would produce. Thus, when the Japanese keyboard driver is not loaded (e.g. in the BIOS setup screen or in a "bare" DOS environment), the Japanese keyboard behaves as if the US keyboard. i.e. the at mark key produces left bracket, shift + minus key does underscore.

However, pay attention to the right bracket (]) key in the USB keyboard.

Japanese keyboard scancode (AT) scancode (USB) US keyboard
hankaku/zenkaku 0x29 0x35 `
@ 0x1A 0x2F [
[ 0x1B 0x30 ]
] 0x2B
backslash

0x32 N/A
N/A
0x31 backslash

Moreover, the Japanese keyboard has 5 additional keys, which have their own scancodes.

key scancode (AT) scancode (USB) name (USB)
backslash (underscore) 0x73 0x87 Keyboard international 1
hiragana 0x79 0x88 Keyboard international 2
yen mark 0x7D 0x89 Keyboard international 3
henkan 0x70 0x8A Keyboard international 4
muhenkan 0x7B 0x8B Keyboard international 5

Other Japanese Keyboards


References