File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed
app/src/main/java/com/limelight Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -1272,8 +1272,16 @@ public boolean onKeyDown(int keyCode, KeyEvent event) {
1272
1272
1273
1273
@ Override
1274
1274
public boolean handleKeyDown (KeyEvent event ) {
1275
- // Pass-through virtual navigation keys
1275
+ // Handle ( virtual) Navigation Keys
1276
1276
if ((event .getFlags () & KeyEvent .FLAG_VIRTUAL_HARD_KEY ) != 0 ) {
1277
+ // Show Game Menu on back action instead of finishing the activity, the user has to
1278
+ // select "Disconnect" within the game menu to actually disconnect
1279
+ if (event .getKeyCode () == KeyEvent .KEYCODE_BACK ) {
1280
+ showGameMenu (null );
1281
+ return true ;
1282
+ }
1283
+
1284
+ // Pass-through other navigation keys
1277
1285
return false ;
1278
1286
}
1279
1287
@@ -2270,16 +2278,7 @@ public void showGameMenu(GameInputDevice device) {
2270
2278
public boolean onKey (View view , int keyCode , KeyEvent keyEvent ) {
2271
2279
switch (keyEvent .getAction ()) {
2272
2280
case KeyEvent .ACTION_DOWN :
2273
- boolean handled = handleKeyDown (keyEvent );
2274
- if (handled )
2275
- return true ;
2276
-
2277
- // Intercept back key event before android handles it
2278
- // Always handle the request, the user has to select "Disconnect" within the game menu to actually disconnect
2279
- if (keyCode == keyEvent .KEYCODE_BACK ) {
2280
- showGameMenu (null );
2281
- return true ;
2282
- }
2281
+ return handleKeyDown (keyEvent );
2283
2282
case KeyEvent .ACTION_UP :
2284
2283
return handleKeyUp (keyEvent );
2285
2284
default :
You can’t perform that action at this time.
0 commit comments