Exemple #1
0
        public override bool OnKeyUp(Keycode keyCode, KeyEvent keyEvent)
        {
            //Log.Info(TAG, "OnKeyUp=" + (int)keyCode);
            int playerNum = OuyaController.getPlayerNumByDeviceId(keyEvent.DeviceId);

            if (playerNum >= 0 && playerNum < 4)
            {
                if ((int)keyCode == OuyaController.BUTTON_DPAD_DOWN)
                {
                    _game.GetFocusManager().FocusDown();
                }
                if ((int)keyCode == OuyaController.BUTTON_DPAD_LEFT)
                {
                    _game.GetFocusManager().FocusLeft();
                }
                if ((int)keyCode == OuyaController.BUTTON_DPAD_RIGHT)
                {
                    _game.GetFocusManager().FocusRight();
                }
                if ((int)keyCode == OuyaController.BUTTON_DPAD_UP)
                {
                    _game.GetFocusManager().FocusUp();
                }
                if ((int)keyCode == OuyaController.BUTTON_O)
                {
                    _game.GetFocusManager().InvokeClick();
                }
                if ((int)keyCode == OuyaController.BUTTON_A)
                {
                    _game.Exit();
                }
            }
            return(true);
        }