Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions app/src/main/java/com/limelight/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -1293,6 +1293,18 @@ private byte getModifierState(KeyEvent event) {
if (event.isMetaPressed()) {
modifier |= KeyboardPacket.MODIFIER_META;
}
return applyKeySpecificModifiers(event.getKeyCode(), modifier);
}

private byte getModifierState(int keyCode) {
return applyKeySpecificModifiers(keyCode, getModifierState());
}

private byte applyKeySpecificModifiers(int keyCode, byte modifier) {
if (keyCode == KeyEvent.KEYCODE_PLUS) {
// The host protocol has a single US =/+ virtual key, so Android's semantic plus key needs Shift.
modifier |= KeyboardPacket.MODIFIER_SHIFT;
}
return modifier;
}

Expand Down Expand Up @@ -2612,10 +2624,10 @@ public void keyboardEvent(boolean buttonDown, short keyCode) {
}

if (buttonDown) {
conn.sendKeyboardInput(keyMap, KeyboardPacket.KEY_DOWN, getModifierState(), (byte)0);
conn.sendKeyboardInput(keyMap, KeyboardPacket.KEY_DOWN, getModifierState(keyCode), (byte)0);
}
else {
conn.sendKeyboardInput(keyMap, KeyboardPacket.KEY_UP, getModifierState(), (byte)0);
conn.sendKeyboardInput(keyMap, KeyboardPacket.KEY_UP, getModifierState(keyCode), (byte)0);
}
}
}
Expand Down