Пример #1
0
 /// <summary>
 /// Adds a handler for joystick axis input.
 /// </summary>
 public static void AddInputHandler(
     DeviceType dt,
     OVRGamepadController.Axis axis,
     OnKeyDown onDown,
     OnKeyHeld onHeld,
     OnKeyUp onUp)
 {
     keyInfos.Add(new KeyInfo(dt, axis, onDown, onHeld, onUp));
 }
Пример #2
0
 // joystick axis constructor
 public KeyInfo(eDeviceType inDeviceType,
                OVRGamepadController.Axis inJoystickAxis,
                OnKeyDown inDownHandler,
                OnKeyHeld inHeldHandler,
                OnKeyUp inUpHandler)
 {
     DeviceType     = inDeviceType;
     KeyName        = OVRGamepadController.AxisNames[(int)inJoystickAxis];
     MouseButton    = eMouseButton.None;
     JoystickButton = OVRGamepadController.Button.None;
     JoystickAxis   = inJoystickAxis;
     Threshold      = 0.5f;
     WasDown        = false;
     DownHandler    = inDownHandler;
     HeldHandler    = inHeldHandler;
     UpHandler      = inUpHandler;
 }
Пример #3
0
 /// <summary>
 /// Joystick axis constructor.
 /// </summary>
 public KeyInfo(
     DeviceType inDeviceType,
     OVRGamepadController.Axis inJoystickAxis,
     OnKeyDown inDownHandler,
     OnKeyHeld inHeldHandler,
     OnKeyUp inUpHandler)
 {
     deviceType     = inDeviceType;
     keyName        = OVRGamepadController.AxisNames[(int)inJoystickAxis];
     mouseButton    = MouseButton.None;
     joystickButton = OVRGamepadController.Button.None;
     joystickAxis   = inJoystickAxis;
     threshold      = 0.5f;
     wasDown        = false;
     downHandler    = inDownHandler;
     heldHandler    = inHeldHandler;
     upHandler      = inUpHandler;
 }
Пример #4
0
 /// <summary>
 /// Mouse button constructor.
 /// </summary>
 public KeyInfo(
     DeviceType inDeviceType,
     MouseButton inMouseButton,
     OnKeyDown inDownHandler,
     OnKeyHeld inHeldHandler,
     OnKeyUp inUpHandler)
 {
     deviceType     = inDeviceType;
     keyName        = "Mouse Button " + (int)inMouseButton;
     mouseButton    = inMouseButton;
     joystickButton = OVRGamepadController.Button.None;
     joystickAxis   = OVRGamepadController.Axis.None;
     threshold      = 1000.0f;
     wasDown        = false;
     downHandler    = inDownHandler;
     heldHandler    = inHeldHandler;
     upHandler      = inUpHandler;
 }
Пример #5
0
		/// <summary>
		/// Joystick axis constructor.
		/// </summary>
		public KeyInfo(
				DeviceType inDeviceType,
				OVRGamepadController.Axis inJoystickAxis,
				OnKeyDown inDownHandler,
				OnKeyHeld inHeldHandler,
				OnKeyUp inUpHandler)
		{
			deviceType = inDeviceType;
			keyName = OVRGamepadController.AxisNames[(int)inJoystickAxis];
			mouseButton = MouseButton.None;
			joystickButton = OVRGamepadController.Button.None;
			joystickAxis = inJoystickAxis;
			threshold = 0.5f;
			wasDown = false;
			downHandler = inDownHandler;
			heldHandler = inHeldHandler;
			upHandler = inUpHandler;
		}
Пример #6
0
		/// <summary>
		/// Mouse button constructor.
		/// </summary>
		public KeyInfo(
				DeviceType inDeviceType,
				MouseButton inMouseButton,
				OnKeyDown inDownHandler,
				OnKeyHeld inHeldHandler,
				OnKeyUp inUpHandler)
		{
			deviceType = inDeviceType;
			keyName = "Mouse Button " + (int)inMouseButton;
			mouseButton = inMouseButton;
			joystickButton = OVRGamepadController.Button.None;
			joystickAxis = OVRGamepadController.Axis.None;
			threshold = 1000.0f;
			wasDown = false;
			downHandler = inDownHandler;
			heldHandler = inHeldHandler;
			upHandler = inUpHandler;
		}
Пример #7
0
 /// <summary>
 /// Delegate for OVRGamepadController.
 /// This only exists for legacy compatibility with OVRGamepadController.
 /// </summary>
 public static float ReadJoystickAxis(OVRGamepadController.Axis axis)
 {
     //if (verbose)
     //Debug.Log("OVRInputControl.ReadJoystickAxis");
     return(GetJoystickAxis(1, axis));
 }
Пример #8
0
    /// <summary>
    /// Delegate for OVRGamepadController.
    /// Returns the current value of the specified joystick axis.
    /// </summary>
    public static float GetJoystickAxis(int joystickNumber, OVRGamepadController.Axis axis)
    {
        string platformName = platformPrefix + "Joy " + joystickNumber + ":" + OVRGamepadController.AxisNames[(int)axis];

        return(Input.GetAxis(platformName));
    }
Пример #9
0
 //======================
 // ReadJoystickAxis
 // delegate for OVRGamepadController
 // This only exists for legacy compatibility with OVRGamepadController.
 //======================
 public static float ReadJoystickAxis(OVRGamepadController.Axis axis)
 {
     //DebugUtils.Print( "InputControl.ReadJoystickAxis" );
     return(GetJoystickAxis(1, axis));
 }
Пример #10
0
        // joystick axis constructor
        public KeyInfo( eDeviceType inDeviceType, 
						OVRGamepadController.Axis inJoystickAxis,
						OnKeyDown inDownHandler, 
						OnKeyHeld inHeldHandler, 
						OnKeyUp inUpHandler )
        {
            DeviceType = inDeviceType;
                    KeyName = OVRGamepadController.AxisNames[(int)inJoystickAxis];
                    MouseButton = eMouseButton.None;
                    JoystickButton = OVRGamepadController.Button.None;
                    JoystickAxis = inJoystickAxis;
                    Threshold = 0.5f;
                    WasDown = false;
                    DownHandler = inDownHandler;
                    HeldHandler = inHeldHandler;
                    UpHandler = inUpHandler;
        }
Пример #11
0
        // mouse button constructor
        public KeyInfo( eDeviceType inDeviceType, 
						eMouseButton inMouseButton,
						OnKeyDown inDownHandler, 
						OnKeyHeld inHeldHandler, 
						OnKeyUp inUpHandler )
        {
            DeviceType = inDeviceType;
                    KeyName = "Mouse Button " + (int)inMouseButton;
                    MouseButton = inMouseButton;
                    JoystickButton = OVRGamepadController.Button.None;
                    JoystickAxis = OVRGamepadController.Axis.None;
                    Threshold = 1000.0f;
                    WasDown = false;
                    DownHandler = inDownHandler;
                    HeldHandler = inHeldHandler;
                    UpHandler = inUpHandler;
        }