예제 #1
0
        private void _initializeInputs()
        {
            Console.Write("Initializing inputs... ");

            _directInput = ToDispose<DirectInput>(new DirectInput());

            _dKeyboard = ToDispose<DKeyboard>(new DKeyboard(_directInput));
            _dKeyboard.Properties.BufferSize = 256;
            _dKeyboard.SetCooperativeLevel(_form, CooperativeLevel.Foreground | CooperativeLevel.Exclusive);
            Keyboard = new Keyboard(_dKeyboard);

            _dMouse = ToDispose<DMouse>(new DMouse(_directInput));
            _dMouse.Properties.AxisMode = DeviceAxisMode.Relative;
            _dMouse.SetCooperativeLevel(_form, CooperativeLevel.Foreground | CooperativeLevel.NonExclusive);
            Mouse = new Mouse(_form, _dMouse);
            Console.WriteLine("done.");
        }