/// <summary>
        /// Update the device state. Calling at each tick.
        /// </summary>
        protected override void OnUpdateState()
        {
            //button1
            {
                bool pressed = EngineApp.Instance.IsKeyPressed(EKeys.H);
                if (Buttons[0].Pressed != pressed)
                {
                    if (pressed)
                    {
                        InputDeviceManager.Instance.SendEvent(
                            new JoystickButtonDownEvent(this, Buttons[0]));
                    }
                    else
                    {
                        InputDeviceManager.Instance.SendEvent(
                            new JoystickButtonUpEvent(this, Buttons[0]));
                    }
                    Buttons[0].Pressed = pressed;
                }
            }

            //button2
            {
                bool pressed = EngineApp.Instance.IsKeyPressed(EKeys.J);
                if (Buttons[1].Pressed != pressed)
                {
                    if (pressed)
                    {
                        InputDeviceManager.Instance.SendEvent(
                            new JoystickButtonDownEvent(this, Buttons[1]));
                    }
                    else
                    {
                        InputDeviceManager.Instance.SendEvent(
                            new JoystickButtonUpEvent(this, Buttons[1]));
                    }
                    Buttons[1].Pressed = pressed;
                }
            }

            //axis X
            {
                float value = MathFunctions.Sin(EngineApp.Instance.Time * 2.0f);

                Axes[0].Value = value;

                InputDeviceManager.Instance.SendEvent(
                    new JoystickAxisChangedEvent(this, Axes[0]));
            }

            //custom event example
            {
                //this event will be caused in the EngineApp.OnCustomInputDeviceEvent()
                //and in the all gui controls EControl.OnCustomInputDeviceEvent().
                ExampleCustomInputDeviceSpecialEvent customEvent =
                    new ExampleCustomInputDeviceSpecialEvent(this);
                InputDeviceManager.Instance.SendEvent(customEvent);
            }
        }
        /// <summary>
        /// Update the device state. Calling at each tick.
        /// </summary>
        protected override void OnUpdateState()
        {
            //button1
            {
                bool pressed = EngineApp.Instance.IsKeyPressed(EKeys.H);
                if (Buttons[0].Pressed != pressed)
                {
                    if (pressed)
                    {
                        InputDeviceManager.Instance.SendEvent(
                            new JoystickButtonDownEvent(this, Buttons[0]));
                    }
                    else
                    {
                        InputDeviceManager.Instance.SendEvent(
                            new JoystickButtonUpEvent(this, Buttons[0]));
                    }
                    Buttons[0].Pressed = pressed;
                }
            }

            //button2
            {
                bool pressed = EngineApp.Instance.IsKeyPressed(EKeys.J);
                if (Buttons[1].Pressed != pressed)
                {
                    if (pressed)
                    {
                        InputDeviceManager.Instance.SendEvent(
                            new JoystickButtonDownEvent(this, Buttons[1]));
                    }
                    else
                    {
                        InputDeviceManager.Instance.SendEvent(
                            new JoystickButtonUpEvent(this, Buttons[1]));
                    }
                    Buttons[1].Pressed = pressed;
                }
            }

            //axis X
            {
                float value = MathFunctions.Sin(EngineApp.Instance.Time * 2.0f);

                Axes[0].Value = value;

                InputDeviceManager.Instance.SendEvent(
                    new JoystickAxisChangedEvent(this, Axes[0]));
            }

            //custom event example
            {
                //this event will be caused in the EngineApp.OnCustomInputDeviceEvent()
                //and in the all gui controls EControl.OnCustomInputDeviceEvent().
                ExampleCustomInputDeviceSpecialEvent customEvent =
                    new ExampleCustomInputDeviceSpecialEvent(this);
                InputDeviceManager.Instance.SendEvent(customEvent);
            }
        }