void OnEnable() { InputManager.OnDeviceDetached += OnDeviceDetached; keyboardListener = ArmActions.CreateWithKeyboardBindings(); joystickListener = ArmActions.CreateWithJoystickBindings(); headKeyboardListener = HeadActions.CreateWithKeyboardBindings(); headJoystickListener = HeadActions.CreateWithJoystickBindings(); }
public static ArmActions CreateWithKeyboardBindings() { var actions = new ArmActions(); actions.Grab.AddDefaultBinding( Key.Space ); actions.WristRotateLeft.AddDefaultBinding( Key.LeftArrow ); actions.WristRotateRight.AddDefaultBinding( Key.RightArrow ); actions.WristExtend.AddDefaultBinding( Key.UpArrow ); actions.WristRetract.AddDefaultBinding( Key.DownArrow ); actions.ElbowExtend.AddDefaultBinding( Key.W ); actions.ElbowRetract.AddDefaultBinding( Key.S ); actions.ShoulderLiftUp.AddDefaultBinding (Key.A); actions.ShoulderDropDown.AddDefaultBinding (Key.D); return actions; }
public static ArmActions CreateWithJoystickBindings() { var actions = new ArmActions(); actions.Grab.AddDefaultBinding ( InputControlType.Action1); actions.ElbowExtend.AddDefaultBinding( InputControlType.LeftStickUp ); actions.ElbowRetract.AddDefaultBinding( InputControlType.LeftStickDown ); actions.ShoulderLiftUp.AddDefaultBinding( InputControlType.LeftStickLeft ); actions.ShoulderDropDown.AddDefaultBinding( InputControlType.LeftStickRight ); actions.WristRotateLeft.AddDefaultBinding (InputControlType.RightStickLeft ); actions.WristRotateRight.AddDefaultBinding (InputControlType.RightStickRight ); actions.WristExtend.AddDefaultBinding (InputControlType.RightStickUp); actions.WristRetract.AddDefaultBinding (InputControlType.RightStickDown); return actions; }
bool JoinButtonWasPressedOnListener( ArmActions actions ) { return actions.Grab.WasPressed; }