Last Comment Bug 694268 - Modifier keys (e.g. shiftKey) always true for touch events (e.g. touchstart)
: Modifier keys (e.g. shiftKey) always true for touch events (e.g. touchstart)
[pushed], QA?
: testcase
Product: Fennec Graveyard
Classification: Graveyard
Component: General (show other bugs)
: Firefox 8
: All All
-- normal (vote)
: Firefox 10
Assigned To: Matt Brubeck (:mbrubeck)
Depends on:
Blocks: 544614 695407
  Show dependency treegraph
Reported: 2011-10-13 02:53 PDT by Samat Jain
Modified: 2013-12-10 10:00 PST (History)
6 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---

Testcase for shiftKey, ctrlKey and touchstart, touchmove, touchend (944 bytes, text/html)
2011-10-13 02:53 PDT, Samat Jain
no flags Details
patch (1.48 KB, patch)
2011-10-17 12:24 PDT, Matt Brubeck (:mbrubeck)
wjohnston2000: review+
Details | Diff | Splinter Review

Description User image Samat Jain 2011-10-13 02:53:48 PDT
Created attachment 566771 [details]
Testcase for shiftKey, ctrlKey and touchstart, touchmove, touchend

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0a2) Gecko/20111012 Firefox/9.0a2
Build ID: 20111012092043

Steps to reproduce:

Attempt to fire touch events (touchstart, touchmove, touchend, possibly others?) across an element (i.e. start dragging over a colored area in attached test case).

Tested w/ Fennec 8b2 on both Linux on x86-64 and Android 2.3 on T-Mobile G2 (HTC Vision).

Actual results:

Event handler is called with an event object whose shiftKey and ctrlKey (possibly others?) attributes are set to true.

Expected results:

Since shift or control keys were not pressed (or rather, they do not exist for most mobile devices), both shiftKey and ctrlKey attributes should be false.

For consistency, with WebKit on the same device the attributes are also false. I've not tried WebKit's behavior w/ a BlueTooth keyboard attached to see whether it is different.
Comment 1 User image Makoto Kato [:m_kato] 2011-10-13 04:14:17 PDT

In mobile/chrome/content/content.js, event seems to be initialized by shiftkey/ctrlKey = true...
Comment 2 User image Matt Brubeck (:mbrubeck) 2011-10-17 12:24:52 PDT
Created attachment 567531 [details] [diff] [review]

Huh, I'm not sure how this slipped through.

To start with, this patch just sets the modifier flags to "false" all the time.  I'll file a followup bug to set them correctly based on which keys are actually pressed.
Comment 4 User image Matt Brubeck (:mbrubeck) 2011-10-18 11:16:02 PDT
Oops, accidentally closed this when pushing to inbound.  Re-opening because this is not on mozilla-central yet.
Comment 5 User image Matt Brubeck (:mbrubeck) 2011-10-18 11:23:00 PDT
Filed bug 695407 to fix this for real on devices with keyboards.
Comment 6 User image Marco Bonardo [::mak] 2011-10-19 03:14:03 PDT

Note You need to log in before you can comment on or make changes to this bug.