Added MetaKey(WindowKey) Packet

Allows you to use Windows key combinations.

ex) Win+Tab , Win+D
This commit is contained in:
luten145 authored and Cameron Gutman committed 2022-11-13 17:15:22 -06:00
1 parent 56eddff8d6
commit 26bff28e4d
2 files changed
+9 -1

No files matched your search

@@ -1164,6 +1164,10 @@ public class Game extends Activity implements SurfaceHolder.Callback,
androidKeyCode == KeyEvent.KEYCODE_ALT_RIGHT) {
modifierMask = KeyboardPacket.MODIFIER_ALT;
}
else if (androidKeyCode == KeyEvent.KEYCODE_META_LEFT ||
androidKeyCode == KeyEvent.KEYCODE_META_RIGHT) {
modifierMask = KeyboardPacket.MODIFIER_META;
}
if (down) {
this.modifierFlags |= modifierMask;
@@ -1226,6 +1230,9 @@ public class Game extends Activity implements SurfaceHolder.Callback,
if (event.isAltPressed()) {
modifier |= KeyboardPacket.MODIFIER_ALT;
}
if (event.isMetaPressed()) {
modifier |= KeyboardPacket.MODIFIER_META;
}
return modifier;
}
@@ -7,4 +7,5 @@ public class KeyboardPacket {
public static final byte MODIFIER_SHIFT = 0x01;
public static final byte MODIFIER_CTRL = 0x02;
public static final byte MODIFIER_ALT = 0x04;
}
public static final byte MODIFIER_META = 0x08;
}