Proposal for how to handle keys on devices with keypads rather than keyboards

We provide a recommended list of mappings:

   Left key (e.g. on keypad joystick) - "Left"
   Right key (e.g. on keypad joystick) - "Right"
   Up key (e.g. on keypad joystick) - "Up"
   Down key (e.g. on keypad joystick) - "Down"
   OK key (e.g. pushing on keypad joystick) - "Enter"
   Left soft key - "F1"
   Right soft key - "F2"
   Dial key - "Dial" (this is a new identifier)
   Hangup key - "Hangup" (this is a new identifier)
   Back key - "U+0008" (Backspace)
   Cancel key - "U+001B" (Escape)
   1 .. 9 keys - "U+0031" .. "U+0039"
   * - "U+002A"
   0 - "U+0030"
   # - "U+0023"

In addition, we add this to the KeyboardEvent interface:

  const unsigned long       DOM_KEY_LOCATION_KEYPAD        = 0x04;

...and make all the key events for the above keys have that location set.

IME would cause all these to generate the full textInput events.

e.g., tapping "2" twice would do:

   keydown, "U+0032", DOM_KEY_LOCATION_KEYPAD
   keyup, "U+0032", DOM_KEY_LOCATION_KEYPAD
   keydown, "U+0032", DOM_KEY_LOCATION_KEYPAD
   keyup, "U+0032", DOM_KEY_LOCATION_KEYPAD
   textinput, "b"

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Tuesday, 2 May 2006 19:07:39 UTC