Example #1
0
        /// <summary>
        /// Inicializace joysticku/gamepadu
        /// </summary>
        private void inicializeJoystick()
        {
            controllView.showControlMessage(MessageTypeEnum.progress, "Probíhá inicializace ovládacího zařízení.");
            JoystickBridge joystickBridge = new JoystickBridge();

            joystick = joystickBridge.getJoystick();
            joystick.onOff(false);
            joystick.subscribeDirectMoveStickObserver(joystickDirectMoveChanged);
            joystick.subscribeMoveStickObserver(joystickMoveChanged);
            joystick.subscribeButtonMoveUpObserver(joystickButtonMoveUpChanged);
            joystick.subscribeButtonMoveDownObserver(joystickButtonMoveDownChanged);
            joystick.subscribeButtonNarrowObserver(joystickButtonNarrowChanged);
            joystick.subscribeButtonWidenObserver(joystickButtonWidenChanged);
            joystick.subscribeButtonDefaultPositionObserver(joystickButtonDefaultPositionChanged);
            joystick.subscribeButtonRotateLeftObserver(joystickButtonRotateLeftChanged);
            joystick.subscribeButtonRotateRightObserver(joystickButtonRotateRightChanged);
            joystick.subscribeButtonStopObserver(joystickButtonStopChanged);
            joystick.subscribeButtonTiltBackObserver(joystickButtonTiltBackChanged);
            joystick.subscribeButtonTiltFrontObserver(joystickButtonTiltFrontChanged);
            joystick.subscribeButtonTiltLeftObserver(joystickButtonTiltLeftChanged);
            joystick.subscribeButtonTiltRightObserver(joystickButtonTiltRightChanged);
            joystick.subscribeFrontNarrowObserver(joysticFrontNarrowChanged);
            joystick.subscribeBackNarrowObserver(joystickBackNarrowChanged);
            joystick.subscribeErrorObserver(refindJoystick);
            if (!joystickBridge.success)
            {
                gamePadChecker.Enabled = true;
                controllView.showControlMessage(MessageTypeEnum.error, joystickBridge.message);
            }
            else
            {
                controllView.showControlMessage(MessageTypeEnum.success, joystickBridge.message);
            }
        }