Warning:
This wiki has been archived and is now read-only.
Joystick
From WEBAPPS
WebApps ⇨ DOM3Events ⇨ Joystick
From Robin Berjon:
New Key Identifiers JoystickUp The joystick's up orientation. JoystickDown The joystick's down orientation. JoystickLeft The joystick's left orientation. JoystickRight The joystick's right orientation. JoystickOk The joystick's OK. MobileLeft The left application key on a mobile device. MobileRight The right application key on a mobile device.
From Doug Schepers:
* Intensity of directionality: some joysticks have faster movement the further the stick is pushed from center. It is sometimes gradual, and sometimes there is a quantum threshold. I propose that we have a single property that captures this, somewhat like "wheelDelta". Perhaps "magnitude" or "intensity" (my girlfriend suggests "increasification" because it sounds Presidential), with a value from 0 to 1 ("0" would be the minimum, not null).
From Ian Hickson (with agreement by Maciej Stachowiak, Jonas Sicking, and Cameron McCormack):
Why not use these?: Up Down Left Right Enter F1 F2 ...? That way applications built to support arrow keys automatically work on mobile devices without having to do anything special.
From Cameron McCormack:
I don't see any benefit from having these as separate key identifiers unless you know of input devices that have both the traditional arrow keys and the joystick buttons, since, as Ian said, using common key identifiers will allow scripts to work with keyboards and mobile keypads. What about using KeyboardEvent.keyLocation to distinguish these two? DOM_KEY_LOCATION_NUMPAD could be used for the joystick presses (the mobile keyboard is sort of like the numpad on a computer keyboard).
Proposal
Use Up
, Down
, Left
, Right
keys instead of the joystick directions, with the value DOM_KEY_LOCATION_MOBILE
(or DOM_KEY_LOCATION_KEYPAD
, or DOM_KEY_LOCATION_NUMPAD
) for KeyboardEvent.keyLocation.
Introduce an OK
key, or just use Enter
? Would it be smart to set up some equivalencies among certain keys like this, for more portable code?