//====================== // AddInputHandler // Adds a hander for mouse button input //====================== public static void AddInputHandler(eDeviceType dt, eMouseButton mouseButton, OnKeyDown onDown, OnKeyHeld onHeld, OnKeyUp onUp, int joystickNum = 0, bool exc = false) { KeyInfo k = new KeyInfo(dt, mouseButton, onDown, onHeld, onUp); k.WasDown = GetMouseButton(mouseButton); k.exclusive = exc; InputMap[joystickNum].KeyInfos.Add(k); }
//====================== // AddInputHandler // Adds a hander for key input //====================== public static void AddInputHandler(eDeviceType dt, string keyName, OnKeyDown onDown, OnKeyHeld onHeld, OnKeyUp onUp, int joystickNum = 0, bool exc = false) { KeyInfo k = new KeyInfo(dt, keyName, onDown, onHeld, onUp); k.WasDown = Input.GetKey(keyName); k.exclusive = exc; InputMap[joystickNum].KeyInfos.Add(k); }
// 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; }
// 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; }
// key constructor public KeyInfo( eDeviceType inDeviceType, string inKeyName, OnKeyDown inDownHandler, OnKeyHeld inHeldHandler, OnKeyUp inUpHandler ) { DeviceType = inDeviceType; KeyName = inKeyName; MouseButton = eMouseButton.None; JoystickButton = OVRGamepadController.Button.None; JoystickAxis = OVRGamepadController.Axis.None; Threshold = 1000.0f; WasDown = false; DownHandler = inDownHandler; HeldHandler = inHeldHandler; UpHandler = inUpHandler; }
// joystick button constructor public KeyInfo(eDeviceType inDeviceType, Button inJoystickButton, OnKeyDown inDownHandler, OnKeyHeld inHeldHandler, OnKeyUp inUpHandler) { DeviceType = inDeviceType; KeyName = ButtonNames[(int)inJoystickButton]; MouseButton = eMouseButton.None; JoystickButton = inJoystickButton; JoystickAxis = Axis.None; Threshold = 1000.0f; WasDown = false; DownHandler = inDownHandler; HeldHandler = inHeldHandler; UpHandler = inUpHandler; }
public setForm(eDeviceType edevType, string strCustomNum, string strClassNum, string strDeviceNum) { InitializeComponent(); if (edevType == eDeviceType.Gateway) { this.label3.Hide(); this.textBox3.Hide(); } nDeviceM = edevType; this.textBox1.Text = strCustomNum; this.textBox2.Text = strClassNum; if (nDeviceM != eDeviceType.Gateway) { this.textBox3.Text = strDeviceNum; } if (edevType == eDeviceType.Gateway) { this.textBox3.Hide(); this.label3.Hide(); } }
//====================== // AddInputHandler // Adds a hander for joystick axis input //====================== public static void AddInputHandler(eDeviceType dt, OVRGamepadController.Axis axis, OnKeyDown onDown, OnKeyHeld onHeld, OnKeyUp onUp) { KeyInfos.Add(new KeyInfo(dt, axis, onDown, onHeld, onUp)); }
//====================== // AddInputHandler // Adds a hander for mouse button input //====================== public static void AddInputHandler(eDeviceType dt, eMouseButton mouseButton, OnKeyDown onDown, OnKeyHeld onHeld, OnKeyUp onUp) { KeyInfos.Add(new KeyInfo(dt, mouseButton, onDown, onHeld, onUp)); }
//====================== // AddInputHandler // Adds a hander for key input //====================== public static void AddInputHandler(eDeviceType dt, string keyName, OnKeyDown onDown, OnKeyHeld onHeld, OnKeyUp onUp) { KeyInfos.Add(new KeyInfo(dt, keyName, onDown, onHeld, onUp)); }
// 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; }
//====================== // AddInputHandler // Adds a hander for joystick axis input //====================== public static void AddInputHandler( eDeviceType dt, OVRGamepadController.Axis axis, OnKeyDown onDown, OnKeyHeld onHeld, OnKeyUp onUp ) { KeyInfos.Add( new KeyInfo( dt, axis, onDown, onHeld, onUp ) ); }
//====================== // AddInputHandler // Adds a hander for mouse button input //====================== public static void AddInputHandler( eDeviceType dt, eMouseButton mouseButton, OnKeyDown onDown, OnKeyHeld onHeld, OnKeyUp onUp ) { KeyInfos.Add( new KeyInfo( dt, mouseButton, onDown, onHeld, onUp ) ); }
//====================== // AddInputHandler // Adds a hander for key input //====================== public static void AddInputHandler( eDeviceType dt, string keyName, OnKeyDown onDown, OnKeyHeld onHeld, OnKeyUp onUp ) { KeyInfos.Add( new KeyInfo( dt, keyName, onDown, onHeld, onUp ) ); }
//====================== // AddInputHandler // Adds a hander for joystick axis input //====================== public static void AddInputHandler(eDeviceType dt, Axis axis, OnKeyDown onDown, OnKeyHeld onHeld, OnKeyUp onUp, int joystickNum = 0) { InputMap[joystickNum].KeyInfos.Add(new KeyInfo(dt, axis, onDown, onHeld, onUp)); }