mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-20 03:23:07 +00:00
Make the virtual and hardware back buttons on the devices themselves work as the in-game back button. This is required for Shield's back button to work.
This commit is contained in:
parent
80fdae3673
commit
e1a8f86d4f
@ -96,11 +96,6 @@ public class Game extends Activity implements OnGenericMotionListener, OnTouchLi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||||
|
|
||||||
// Skip keyboard and virtual button events
|
|
||||||
if (event.getSource() == InputDevice.SOURCE_KEYBOARD)
|
|
||||||
return super.onKeyDown(keyCode, event);
|
|
||||||
|
|
||||||
switch (keyCode) {
|
switch (keyCode) {
|
||||||
case KeyEvent.KEYCODE_BUTTON_START:
|
case KeyEvent.KEYCODE_BUTTON_START:
|
||||||
case KeyEvent.KEYCODE_MENU:
|
case KeyEvent.KEYCODE_MENU:
|
||||||
@ -164,11 +159,6 @@ public class Game extends Activity implements OnGenericMotionListener, OnTouchLi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onKeyUp(int keyCode, KeyEvent event) {
|
public boolean onKeyUp(int keyCode, KeyEvent event) {
|
||||||
|
|
||||||
// Skip keyboard and virtual button events
|
|
||||||
if (event.getSource() == InputDevice.SOURCE_KEYBOARD)
|
|
||||||
return super.onKeyUp(keyCode, event);
|
|
||||||
|
|
||||||
switch (keyCode) {
|
switch (keyCode) {
|
||||||
case KeyEvent.KEYCODE_BUTTON_START:
|
case KeyEvent.KEYCODE_BUTTON_START:
|
||||||
case KeyEvent.KEYCODE_MENU:
|
case KeyEvent.KEYCODE_MENU:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user