Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void UpdateLastActiveInputType (ControllerStatusChangedEventArgs args = null)
- {
- Controller activeController = _player.controllers.GetLastActiveController();
- if ( activeController != null )
- {
- //Logger.Log(LogType.UI, "UpdateControlsNew(" + _player.controllers.GetLastActiveController().hardwareIdentifier + ")");
- switch ( activeController.type )
- {
- case ControllerType.Keyboard:
- JoystickMode = JoystickMode.KeyboardAndMouse;
- break;
- case ControllerType.Joystick:
- if ( activeController.hardwareIdentifier == "WindowsXInputGamepadGamepad" || activeController.hardwareIdentifier == "WindowsFallbackController(XEOXGamepad)" )
- JoystickMode = JoystickMode.XBox;
- else if ( activeController.hardwareIdentifier.Contains("Steam") ) // ?
- JoystickMode = JoystickMode.Steam;
- else
- JoystickMode = JoystickMode.PS;
- break;
- case ControllerType.Mouse:
- JoystickMode = JoystickMode.KeyboardAndMouse;
- break;
- case ControllerType.Custom:
- JoystickMode = JoystickMode.KeyboardAndMouse;
- break;
- }
- }
- else
- {
- // если ничего не нажимали ещё то клавомышь выбираем
- //Logger.Log(LogType.UI, "UpdateControlsNew(no active controller : set keyboard and mouse by default)");
- JoystickMode = JoystickMode.KeyboardAndMouse;
- }
- UpdateJoystickHints();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement