mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 911510 - Add a pref to override the dead zone threshold. r=bnicholson
This commit is contained in:
parent
1da92b26d5
commit
3b7a53f8ad
@ -653,6 +653,9 @@ pref("ui.scrolling.min_scrollable_distance", -1);
|
||||
pref("ui.scrolling.axis_lock_mode", "standard");
|
||||
// Negate scrollY, true will make the mouse scroll wheel move the screen the same direction as with most desktops or laptops.
|
||||
pref("ui.scrolling.negate_wheel_scrollY", true);
|
||||
// Determine the dead zone for gamepad joysticks. Higher values result in larger dead zones; use a negative value to
|
||||
// auto-detect based on reported hardware values
|
||||
pref("ui.scrolling.gamepad_dead_zone", 10);
|
||||
|
||||
|
||||
// Enable accessibility mode if platform accessibility is enabled.
|
||||
|
@ -147,7 +147,9 @@ class JavaPanZoomController
|
||||
|
||||
mMode = AxisLockMode.STANDARD;
|
||||
|
||||
String[] prefs = { "ui.scrolling.axis_lock_mode", "ui.scrolling.negate_wheel_scrollY" };
|
||||
String[] prefs = { "ui.scrolling.axis_lock_mode",
|
||||
"ui.scrolling.negate_wheel_scrollY",
|
||||
"ui.scrolling.gamepad_dead_zone" };
|
||||
mNegateWheelScrollY = false;
|
||||
PrefsHelper.getPrefs(prefs, new PrefsHelper.PrefHandlerBase() {
|
||||
@Override public void prefValue(String pref, String value) {
|
||||
@ -161,6 +163,13 @@ class JavaPanZoomController
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void prefValue(String pref, int value) {
|
||||
if (pref.equals("ui.scrolling.gamepad_dead_zone")) {
|
||||
GamepadUtils.overrideDeadZoneThreshold((float)value / 1000f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void prefValue(String pref, boolean value) {
|
||||
if (pref.equals("ui.scrolling.negate_wheel_scrollY")) {
|
||||
mNegateWheelScrollY = value;
|
||||
|
@ -42,6 +42,10 @@ public final class GamepadUtils {
|
||||
return (isGamepadKey(event) && (event.getKeyCode() == KeyEvent.KEYCODE_BUTTON_B));
|
||||
}
|
||||
|
||||
public static void overrideDeadZoneThreshold(float threshold) {
|
||||
sDeadZoneThresholdOverride = threshold;
|
||||
}
|
||||
|
||||
public static boolean isValueInDeadZone(MotionEvent event, int axis) {
|
||||
if (Build.VERSION.SDK_INT < 9) {
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user