Don't consume special key combos that we don't handle

This commit is contained in:
Cameron Gutman 2023-12-30 19:50:36 -06:00
parent e63dc9a93b
commit 4142907376

View File

@ -1300,10 +1300,20 @@ public class Game extends Activity implements SurfaceHolder.Callback,
else if ((modifierFlags & (KeyboardPacket.MODIFIER_CTRL | KeyboardPacket.MODIFIER_ALT | KeyboardPacket.MODIFIER_SHIFT)) ==
(KeyboardPacket.MODIFIER_CTRL | KeyboardPacket.MODIFIER_ALT | KeyboardPacket.MODIFIER_SHIFT) &&
(down && nonModifierKeyCode != KeyEvent.KEYCODE_UNKNOWN)) {
// Remember that a special key combo was activated, so we can consume all key events until the modifiers come up
specialKeyCode = androidKeyCode;
waitingForAllModifiersUp = true;
return true;
switch (androidKeyCode) {
case KeyEvent.KEYCODE_Z:
case KeyEvent.KEYCODE_Q:
case KeyEvent.KEYCODE_C:
// Remember that a special key combo was activated, so we can consume all key
// events until the modifiers come up
specialKeyCode = androidKeyCode;
waitingForAllModifiersUp = true;
return true;
default:
// This isn't a special combo that we consume on the client side
return false;
}
}
// Not a special combo