Exemplo n.º 1
0
            protected override void InitializeBeforeRun()
            {
                if (Headless)
                {
                    _graphicsDevice = new D3D11GraphicsDevice(new System.Drawing.Size(800, 600));
                }
                else
                {
                    _graphicsDevice = new D3D11GraphicsDevice(MainWindow !);

                    _directInputDevice = new DIInputDevice();

                    _directInputDevice.Initialise(MainWindow.Handle);
                }
            }
Exemplo n.º 2
0
    public static void Main()
    {
        DIInputDevice directInputDevice = new DIInputDevice();

        directInputDevice.Initialize(IntPtr.Zero);

        while (true)
        {
            if (Console.KeyAvailable)
            {
                switch (Console.ReadKey(true).KeyChar)
                {
                case 'q':
                    return;
                }
            }

            directInputDevice.GetKeyboardUpdates();
            directInputDevice.GetKJoystickUpdates();
        }
    }