Skip to content

Commit

Permalink
game menu: add ctrl + v (paste)
Browse files Browse the repository at this point in the history
  • Loading branch information
Karim Mreisi committed Feb 15, 2023
1 parent a960e96 commit ba0b94b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/src/main/java/com/limelight/GameMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ private void showSpecialKeysMenu() {
() -> sendKeys(new short[]{KeyboardTranslator.VK_ESCAPE})),
new MenuOption(getString(R.string.game_menu_send_keys_f11),
() -> sendKeys(new short[]{KeyboardTranslator.VK_F11})),
new MenuOption(getString(R.string.game_menu_send_keys_ctrl_v),
() -> sendKeys(new short[]{KeyboardTranslator.VK_LCONTROL, KeyboardTranslator.VK_V})),
new MenuOption(getString(R.string.game_menu_send_keys_win),
() -> sendKeys(new short[]{KeyboardTranslator.VK_LWIN})),
new MenuOption(getString(R.string.game_menu_send_keys_win_d),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ public class KeyboardTranslator implements InputManager.InputDeviceListener {
public static final int VK_0 = 48;
public static final int VK_9 = 57;
public static final int VK_A = 65;
public static final int VK_C = 67;
public static final int VK_D = 68;
public static final int VK_G = 71;
public static final int VK_V = 86;
public static final int VK_Z = 90;
public static final int VK_NUMPAD0 = 96;
public static final int VK_BACK_SLASH = 92;
Expand Down Expand Up @@ -59,6 +61,7 @@ public class KeyboardTranslator implements InputManager.InputDeviceListener {
public static final int VK_PAUSE = 19;
public static final int VK_LWIN = 91;
public static final int VK_LSHIFT = 160;
public static final int VK_LCONTROL = 162;

private static class KeyboardMapping {
private final InputDevice device;
Expand Down Expand Up @@ -191,7 +194,7 @@ else if (keycode >= KeyEvent.KEYCODE_F1 &&
break;

case KeyEvent.KEYCODE_CTRL_LEFT:
translated = 0xA2;
translated = VK_LCONTROL;
break;

case KeyEvent.KEYCODE_CTRL_RIGHT:
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
<string name="game_menu_send_keys">Send special key(s)</string>
<string name="game_menu_send_keys_esc">Send ESC (Menu)</string>
<string name="game_menu_send_keys_f11">Send F11 (Toggle full screen)</string>
<string name="game_menu_send_keys_ctrl_v">Send CTRL + V (Paste clipboard)</string>
<string name="game_menu_send_keys_win">Send WIN (Toggle Windows start menu)</string>
<string name="game_menu_send_keys_win_d">Send WIN + D (Switch to Desktop)</string>
<string name="game_menu_send_keys_win_g">Send WIN + G (Open Xbox Game Bar)</string>
Expand Down

0 comments on commit ba0b94b

Please sign in to comment.