mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 849845 - Map Gamepad L1/R1 to back/forward on Android. r=kats
This commit is contained in:
parent
ca835e6d03
commit
4e6228dc58
@ -326,9 +326,12 @@ abstract public class BrowserApp extends GeckoApp
|
||||
return false;
|
||||
}
|
||||
|
||||
// Toggle/focus the address bar on gamepad-y button.
|
||||
if (keyCode == KeyEvent.KEYCODE_BUTTON_Y &&
|
||||
// Gamepad support only exists in API-level >= 9
|
||||
if (Build.VERSION.SDK_INT >= 9 &&
|
||||
(event.getSource() & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD) {
|
||||
switch (keyCode) {
|
||||
case KeyEvent.KEYCODE_BUTTON_Y:
|
||||
// Toggle/focus the address bar on gamepad-y button.
|
||||
if (mBrowserToolbar.isVisible()) {
|
||||
if (mDynamicToolbarEnabled &&
|
||||
Boolean.FALSE.equals(mAboutHomeShowing)) {
|
||||
@ -343,8 +346,16 @@ abstract public class BrowserApp extends GeckoApp
|
||||
mBrowserToolbar.animateVisibility(true, 0);
|
||||
mBrowserToolbar.requestFocusFromTouch();
|
||||
}
|
||||
|
||||
return true;
|
||||
case KeyEvent.KEYCODE_BUTTON_L1:
|
||||
// Go back on L1
|
||||
Tabs.getInstance().getSelectedTab().doBack();
|
||||
return true;
|
||||
case KeyEvent.KEYCODE_BUTTON_R1:
|
||||
// Go forward on R1
|
||||
Tabs.getInstance().getSelectedTab().doForward();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user