mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-18 18:42:46 +00:00
fixed button mappings
This commit is contained in:
parent
1be6d8faa3
commit
b256f41a25
@ -58,12 +58,20 @@ public class Game extends Activity {
|
|||||||
conn.start();
|
conn.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||||
|
|
||||||
switch (keyCode) {
|
switch (keyCode) {
|
||||||
case OuyaController.BUTTON_MENU:
|
case OuyaController.BUTTON_MENU:
|
||||||
inputMap |= NvInputPacket.PLAY_FLAG;
|
System.out.println("Menu Pressed");
|
||||||
|
inputMap |= NvInputPacket.BACK_FLAG;
|
||||||
break;
|
break;
|
||||||
case OuyaController.BUTTON_DPAD_LEFT:
|
case OuyaController.BUTTON_DPAD_LEFT:
|
||||||
inputMap |= NvInputPacket.LEFT_FLAG;
|
inputMap |= NvInputPacket.LEFT_FLAG;
|
||||||
@ -112,7 +120,7 @@ public class Game extends Activity {
|
|||||||
public boolean onKeyUp(int keyCode, KeyEvent event) {
|
public boolean onKeyUp(int keyCode, KeyEvent event) {
|
||||||
switch (keyCode) {
|
switch (keyCode) {
|
||||||
case OuyaController.BUTTON_MENU:
|
case OuyaController.BUTTON_MENU:
|
||||||
inputMap &= ~NvInputPacket.PLAY_FLAG;
|
inputMap &= ~NvInputPacket.BACK_FLAG;
|
||||||
break;
|
break;
|
||||||
case OuyaController.BUTTON_DPAD_LEFT:
|
case OuyaController.BUTTON_DPAD_LEFT:
|
||||||
inputMap &= ~NvInputPacket.LEFT_FLAG;
|
inputMap &= ~NvInputPacket.LEFT_FLAG;
|
||||||
|
@ -36,12 +36,12 @@ public class NvInputPacket {
|
|||||||
public static final short DOWN_FLAG = 0x0002;
|
public static final short DOWN_FLAG = 0x0002;
|
||||||
public static final short LEFT_FLAG = 0x0004;
|
public static final short LEFT_FLAG = 0x0004;
|
||||||
public static final short RIGHT_FLAG = 0x0008;
|
public static final short RIGHT_FLAG = 0x0008;
|
||||||
public static final short RB_FLAG = 0x0100;
|
public static final short LB_FLAG = 0x0100;
|
||||||
public static final short LB_FLAG = 0x0200;
|
public static final short RB_FLAG = 0x0200;
|
||||||
public static final short LS_CLK_FLAG = 0x0004;
|
public static final short PLAY_FLAG = 0x0010;
|
||||||
public static final short RS_CLK_FLAG = 0x0008;
|
public static final short BACK_FLAG = 0x0020;
|
||||||
public static final short PLAY_FLAG = 0x0001;
|
public static final short LS_CLK_FLAG = 0x0040;
|
||||||
public static final short BACK_FLAG = 0x0002;
|
public static final short RS_CLK_FLAG = 0x0080;
|
||||||
|
|
||||||
public static final short PACKET_LENGTH = 28;
|
public static final short PACKET_LENGTH = 28;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user