Ejemplo n.º 1
0
 /// <summary>
 /// Sets the wheel direction.
 /// </summary>
 /// <param name="wheelMovement">Movement of the mousewheel.</param>
 private void _setWheelDirection(int wheelMovement)
 {
     // Check if wheel was moved up.
     if (wheelMovement > 0) {
         _wheelDirection = DIMouseWheelDirections.Up;
     }
         // Check if wheel was moved down.
     else if (wheelMovement < 0) {
         _wheelDirection = DIMouseWheelDirections.Down;
     }
         // Wheel is idle.
     else {
         _wheelDirection = DIMouseWheelDirections.Idle;
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes this DIMouse state.
        /// </summary>
        private void _initMouse()
        {
            // Wheel is idle.
            _wheelDirection = DIMouseWheelDirections.Idle;

            // No buttons are being pressed.
            for (DIMouseButtons button = DIMouseButtons.Left; button <= DIMouseButtons.Wheel; button = button + 1) {
                _buttons[(int) button] = false;
            }
        }