From 5843dff2788895ab16ba1a8e752de5be7d6c2350 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 20 Mar 2021 10:24:06 -0500 Subject: [PATCH] Apply new fix for #840 --- app/src/main/java/com/limelight/Game.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/limelight/Game.java b/app/src/main/java/com/limelight/Game.java index d8f0588e..6589c976 100644 --- a/app/src/main/java/com/limelight/Game.java +++ b/app/src/main/java/com/limelight/Game.java @@ -996,8 +996,14 @@ public class Game extends Activity implements SurfaceHolder.Callback, return false; } - private static byte getModifierState(KeyEvent event) { - byte modifier = 0; + // We cannot simply use modifierFlags for all key event processing, because + // some IMEs will not generate real key events for pressing Shift. Instead + // they will simply send key events with isShiftPressed() returning true, + // and we will need to send the modifier flag ourselves. + private byte getModifierState(KeyEvent event) { + // Start with the global modifier state to ensure we cover the case + // detailed in https://github.com/moonlight-stream/moonlight-android/issues/840 + byte modifier = getModifierState(); if (event.isShiftPressed()) { modifier |= KeyboardPacket.MODIFIER_SHIFT; }