Closed
Bug 911510
Opened 12 years ago
Closed 12 years ago
Scrolling and zooming with analog sticks on a gamepad is too sensitive
Categories
(Firefox for Android Graveyard :: Toolbar, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 26
People
(Reporter: oleg.kuznetsov, Assigned: kats)
Details
Attachments
(2 files)
|
2.40 KB,
patch
|
bnicholson
:
review+
|
Details | Diff | Splinter Review |
|
4.42 KB,
patch
|
bnicholson
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (X11; Linux i686; rv:22.0) Gecko/20100101 Firefox/22.0 (Beta/Release)
Build ID: 20130624103921
Steps to reproduce:
1) Connect any gamepad to your device (in my case, it was Xbox 360 wired controller, plugged into USB OTG port)
2) Open any site in Firefox (for example, https://mozilla.org )
3) Slightly push or pull left or right stick
Actual results:
1) Firefox will start scrolling and/or zooming immediately and it won't stop unless the stick will be in a perfect vertical position (which will never happen with an used gamepad).
Expected results:
1) There is should be some threshold, otherwise it's very hard to stop scrolling/zooming, as stick's position must be perfectly vertical.
2) I expected the same behaviour as Chrome does: it doesn't start scrolling unless stick is being pushed or pulled for ~30% of it's path in any direction
| Reporter | ||
Comment 1•12 years ago
|
||
Additional information: I tried it on Firefox 23 and Firefox 24 Beta from Google Play;
My device is Asus Nexus 7 3G (first generation); Installed OS: Android 4.3 (Baseband version: 1231_0.18.0_0409; Kernel version: 3.1.10-g1e8b3d8 android-build@vpbs1.mtv.corp.google.com #1 Tue Jun 11 23:51:41 PDT 2013; Build Number: JWR66V)
Updated•12 years ago
|
Component: General → Graphics, Panning and Zooming
OS: Linux → Android
Hardware: x86 → ARM
| Assignee | ||
Comment 2•12 years ago
|
||
Yeah the current implementation was only tested on an Ouya console, and so the function that checks for dead zone is hard-coded to that. Ideally we would be able to use the hardware-reported value for the deadzone but that doesn't work on the Ouya. We can probably make this value a pref though so that people can configure it differently.
http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/util/GamepadUtils.java#44
Assignee: nobody → bugmail.mozilla
Status: UNCONFIRMED → NEW
Ever confirmed: true
| Assignee | ||
Comment 3•12 years ago
|
||
| Assignee | ||
Comment 4•12 years ago
|
||
Try build pending with these patches at https://tbpl.mozilla.org/?tree=Try&rev=115e27f9e0dc.
| Assignee | ||
Comment 5•12 years ago
|
||
Oleg, can you install the build from http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/kgupta@mozilla.com-115e27f9e0dc/try-android/fennec-26.0a1.en-US.android-arm.apk (it should show up as "Nightly" on your device, and be independent of your regular Firefox install), go to about:config and set the "ui.scrolling.gamepad_dead_zone" pref value to something larger (e.g. 100) and see if that helps with the gamepad joystick issue? Also try setting it to -1 and see if that makes a difference.
Flags: needinfo?(x-pilot)
| Reporter | ||
Comment 6•12 years ago
|
||
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #5)
> Oleg, can you install the build from
> http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/kgupta@mozilla.com-
> 115e27f9e0dc/try-android/fennec-26.0a1.en-US.android-arm.apk (it should show
> up as "Nightly" on your device, and be independent of your regular Firefox
> install), go to about:config and set the "ui.scrolling.gamepad_dead_zone"
> pref value to something larger (e.g. 100) and see if that helps with the
> gamepad joystick issue? Also try setting it to -1 and see if that makes a
> difference.
Setting the value to "250" (or somewhere close to it) helps, while "-1" doesn't. So now I push the stick and Firefox stops scrolling when I release it. Thanks! (I hope, you're aware that this build has rendering issues during zooming)
Flags: needinfo?(x-pilot)
| Assignee | ||
Updated•12 years ago
|
Attachment #799496 -
Flags: review?(bnicholson)
| Assignee | ||
Comment 7•12 years ago
|
||
Comment on attachment 799498 [details] [diff] [review]
Part 2 - Add a pref
I don't think we have a good consensus of what the dead zone should be to work with many devices (sample size = 2 right now) so I'm leaving the default threshold as-is, but people can twiddle it with the pref.
Attachment #799498 -
Flags: review?(bnicholson)
Comment 8•12 years ago
|
||
Comment on attachment 799496 [details] [diff] [review]
Part 1 - Refactor code to make it more easily preffed
Review of attachment 799496 [details] [diff] [review]:
-----------------------------------------------------------------
I was about to suggest that you use hardware-detected values by default, where:
* -1 is the default pref value
* a negative value means try to calculate the hardware-detected values (like it does now), but then use some internal fallback value (e.g., 0.01) if the hardware-detected deadzone is 0
* a non-negative value overrides everything (like it does now)
This would have ideally made this code more accurate across multiple devices, but reading comment 2 and comment 6, it sounds like our hardware detection isn't reliable enough.
If this sample size of 2 is at all representative, the variance among different gamepads can be pretty huge (0.01 on Ouya; 0.25 on Xbox), so I'm concerned that it may not be possible to find a single dead zone constant that works universally. I wonder if there are other techniques we could use to try calculating a dead zone -- maybe 1-2% of the joystick's range? I guess defaulting to a preset value is good enough for now though until we're able to investigate more.
Attachment #799496 -
Flags: review?(bnicholson) → review+
Updated•12 years ago
|
Attachment #799498 -
Flags: review?(bnicholson) → review+
| Assignee | ||
Comment 9•12 years ago
|
||
Yeah if the xbox controller in this bug had worked fine with the hardware detection I would have preferred to just default to that. But since it doesn't I'd rather keep the value we calibrated the Ouya to since I was able to verify that in person.
If we can get more data on what values work for different controllers then we can adjust the default to be a better middle ground.
https://hg.mozilla.org/integration/fx-team/rev/b3cf6b53a990
https://hg.mozilla.org/integration/fx-team/rev/d35a123d53ea
Comment 10•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/b3cf6b53a990
https://hg.mozilla.org/mozilla-central/rev/d35a123d53ea
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 26
Updated•5 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•