Re: ACTION-25: Make a proposal for the additions that the mobile folks have been asking for in keyboard events

* Robin Berjon wrote:
>: Reporting longpress
>
>A new key modifier is introduced, called LongPress. It should be  
>added to the list given in getModifierState(), and it can naturally  
>be used in the modifiersList argument of initKeyboardEvent*(). Since  
>that doesn't necessarily make it sufficiently explicit to authors, an  
>informative paragraph should be added to appendix A (see below).

>It is often the case that a user can hold a key down for a longer  
>period of time in order to modify the behaviour of a given key. This  
>modifier is called "LongPress" and can therefore be queried using  
>getModifierState("LongPress"). Note that depending on the device this  
>information may be available when the keyup event is dispatched but  
>not when the keydown event is.

It is not clear to me how this is supposed to work. There are two points
where you would want to react specifically to long key presses, when the
key is released and when the key press is considered long. Unless it is
expected that in case of a long press "keyup" occurs even if the key has
not been released, the proposed design does not address the second case
at all. Why is this not a keylongpress event, or some field on keypress
event objects (UIEvent.detail would be available, if we add keypress)?

If the above is all we need, I would suggest we don't add this, authors
can easily compare the timeStamps of the keydown and keyup events, the
only problem would be that the script authors does not currently have
reliable access to the delta that would make a press "long", but that
could be easily addressed elsewhere.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 

Received on Saturday, 15 April 2006 12:19:52 UTC