Beispiel #1
0
        public DirectXJoystick(InputManager creator, MDI.DirectInput device, bool buffered, MDI.CooperativeLevel coopSettings)
        {
            Creator            = creator;
            this._directInput  = device;
            IsBuffered         = buffered;
            this._coopSettings = coopSettings;
            Type          = InputType.Joystick;
            EventListener = null;

            this._joyInfo = (JoystickInfo)((DirectXInputManager)Creator).CaptureDevice <Joystick>();

            if (this._joyInfo == null)
            {
                throw new Exception("No devices match requested type.");
            }

            this._deviceGuid = this._joyInfo.DeviceId;
            Vendor           = this._joyInfo.Vendor;
            DeviceID         = this._joyInfo.Id.ToString();
        }
Beispiel #2
0
        public DirectXMouse(InputManager creator, MDI.DirectInput device, bool buffered, MDI.CooperativeLevel coopSettings)
        {
            Creator            = creator;
            this._directInput  = device;
            IsBuffered         = buffered;
            this._coopSettings = coopSettings;
            Type          = InputType.Mouse;
            EventListener = null;

            this._msInfo = (MouseInfo)((DirectXInputManager)Creator).CaptureDevice <Mouse>();

            if (this._msInfo == null)
            {
                throw new Exception("No devices match requested type.");
            }

            this._hideMouse = ((DirectXInputManager)creator).HideMouse;

            Log.Debug("DirectXMouse device created.");
        }
 public void SetCooperativeLevel(SharpDX.DirectInput.CooperativeLevel Level)
 {
     this.joystick.SetCooperativeLevel(MainForm.PublicHandle, Level);
 }