W3C home > Mailing lists > Public > public-webapi@w3.org > May 2006

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

From: Ian Hickson <ian@hixie.ch>
Date: Tue, 2 May 2006 19:07:25 +0000 (UTC)
To: public-webapi@w3.org
Message-ID: <Pine.LNX.4.62.0605021832480.21459@dhalsim.dreamhost.com>


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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:18:55 GMT