mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-02-16 02:20:55 +00:00
Added MetaKey(WindowKey) Packet
Allows you to use Windows key combinations. ex) Win+Tab , Win+D
This commit is contained in:
@@ -1164,6 +1164,10 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
|||||||
androidKeyCode == KeyEvent.KEYCODE_ALT_RIGHT) {
|
androidKeyCode == KeyEvent.KEYCODE_ALT_RIGHT) {
|
||||||
modifierMask = KeyboardPacket.MODIFIER_ALT;
|
modifierMask = KeyboardPacket.MODIFIER_ALT;
|
||||||
}
|
}
|
||||||
|
else if (androidKeyCode == KeyEvent.KEYCODE_META_LEFT ||
|
||||||
|
androidKeyCode == KeyEvent.KEYCODE_META_RIGHT) {
|
||||||
|
modifierMask = KeyboardPacket.MODIFIER_META;
|
||||||
|
}
|
||||||
|
|
||||||
if (down) {
|
if (down) {
|
||||||
this.modifierFlags |= modifierMask;
|
this.modifierFlags |= modifierMask;
|
||||||
@@ -1226,6 +1230,9 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
|||||||
if (event.isAltPressed()) {
|
if (event.isAltPressed()) {
|
||||||
modifier |= KeyboardPacket.MODIFIER_ALT;
|
modifier |= KeyboardPacket.MODIFIER_ALT;
|
||||||
}
|
}
|
||||||
|
if (event.isMetaPressed()) {
|
||||||
|
modifier |= KeyboardPacket.MODIFIER_META;
|
||||||
|
}
|
||||||
return modifier;
|
return modifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,4 +7,5 @@ public class KeyboardPacket {
|
|||||||
public static final byte MODIFIER_SHIFT = 0x01;
|
public static final byte MODIFIER_SHIFT = 0x01;
|
||||||
public static final byte MODIFIER_CTRL = 0x02;
|
public static final byte MODIFIER_CTRL = 0x02;
|
||||||
public static final byte MODIFIER_ALT = 0x04;
|
public static final byte MODIFIER_ALT = 0x04;
|
||||||
}
|
public static final byte MODIFIER_META = 0x08;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user