mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-10-27 06:20:01 +00:00
Add support for newer keycodes from Android 15 and 16
This commit is contained in:
1 parent
6d4c64a575
commit
8974dcda6e
1 file changed
+13
@@ -34,6 +34,7 @@ public class KeyboardTranslator implements InputManager.InputDeviceListener {
|
|||||||
public static final int VK_EQUALS = 61;
|
public static final int VK_EQUALS = 61;
|
||||||
public static final int VK_ESCAPE = 27;
|
public static final int VK_ESCAPE = 27;
|
||||||
public static final int VK_F1 = 112;
|
public static final int VK_F1 = 112;
|
||||||
|
public static final int VK_F13 = 0x7C;
|
||||||
public static final int VK_END = 35;
|
public static final int VK_END = 35;
|
||||||
public static final int VK_HOME = 36;
|
public static final int VK_HOME = 36;
|
||||||
public static final int VK_NUM_LOCK = 144;
|
public static final int VK_NUM_LOCK = 144;
|
||||||
@@ -161,6 +162,10 @@ public class KeyboardTranslator implements InputManager.InputDeviceListener {
|
|||||||
keycode <= KeyEvent.KEYCODE_F12) {
|
keycode <= KeyEvent.KEYCODE_F12) {
|
||||||
translated = (keycode - KeyEvent.KEYCODE_F1) + VK_F1;
|
translated = (keycode - KeyEvent.KEYCODE_F1) + VK_F1;
|
||||||
}
|
}
|
||||||
|
else if (keycode >= KeyEvent.KEYCODE_F13 &&
|
||||||
|
keycode <= KeyEvent.KEYCODE_F24) {
|
||||||
|
translated = (keycode - KeyEvent.KEYCODE_F13) + VK_F13;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
switch (keycode) {
|
switch (keycode) {
|
||||||
case KeyEvent.KEYCODE_ALT_LEFT:
|
case KeyEvent.KEYCODE_ALT_LEFT:
|
||||||
@@ -349,6 +354,14 @@ public class KeyboardTranslator implements InputManager.InputDeviceListener {
|
|||||||
translated = 0x6E;
|
translated = 0x6E;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case KeyEvent.KEYCODE_PRINT:
|
||||||
|
translated = 0x2A;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case KeyEvent.KEYCODE_SCREENSHOT:
|
||||||
|
translated = 0x2C;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user