// ------------------ public void Add( AxisBinding binding, InputRig.InputSource sourceType, string name, string menuPath, Object undoObject) { if ((this.typeMask & BindingDescription.BindingType.Axis) == 0) { return; } if ((this.axisInputSourceMask & (1 << (int)sourceType)) == 0) { return; } string nameFormatted = ((this.menuNameFormatter != null) ? this.menuNameFormatter(binding, name) : name); BindingDescription desc = new BindingDescription(); desc.type = BindingDescription.BindingType.Axis; desc.axisSource = sourceType; desc.name = name; desc.nameFormatted = nameFormatted; desc.menuPath = menuPath; desc.undoObject = undoObject; desc.binding = binding; this.Add(desc); }
// ------------------ public ScrollDeltaBinding(string axisName, bool enabled = false, InputBindingBase parent = null) : base(parent) { this.enabled = enabled; this.deltaBinding = new AxisBinding(axisName, enabled, this); this.positiveDigitalBinding = new DigitalBinding(this); this.negativeDigitalBinding = new DigitalBinding(this); }
// ------------------ public JoystickStateBinding(InputBindingBase parent = null) : base(parent) { this.enabled = false; this.horzAxisBinding = new AxisBinding(this); this.vertAxisBinding = new AxisBinding(this); this.dirBinding = new DirectionBinding(this); }
// ------------------ public TouchGestureStateBinding(InputBindingBase parent = null) : base(parent) { this.enabled = false; this.rawPressBinding = new DigitalBinding(this); this.longPressBinding = new DigitalBinding(this); this.normalPressBinding = new DigitalBinding(this); //this.releasedBinding = new DigitalBinding(this); this.tapBinding = new DigitalBinding(this); this.doubleTapBinding = new DigitalBinding(this); this.longTapBinding = new DigitalBinding(this); this.normalPressSwipeHorzAxisBinding = new AxisBinding(this); this.normalPressSwipeVertAxisBinding = new AxisBinding(this); this.longPressSwipeHorzAxisBinding = new AxisBinding(this); this.longPressSwipeVertAxisBinding = new AxisBinding(this); this.normalPressScrollHorzBinding = new ScrollDeltaBinding(this); this.normalPressScrollVertBinding = new ScrollDeltaBinding(this); this.longPressScrollHorzBinding = new ScrollDeltaBinding(this); this.longPressScrollVertBinding = new ScrollDeltaBinding(this); this.rawPressEmuTouchBinding = new EmuTouchBinding(this); this.normalPressEmuTouchBinding = new EmuTouchBinding(this); this.longPressEmuTouchBinding = new EmuTouchBinding(this); this.rawPressMousePosBinding = new MousePositionBinding(10, false, this); this.normalPressMousePosBinding = new MousePositionBinding(20, false, this); this.longPressMousePosBinding = new MousePositionBinding(20, false, this); this.tapMousePosBinding = new MousePositionBinding(30, false, this); this.doubleTapMousePosBinding = new MousePositionBinding(30, false, this); this.longTapMousePosBinding = new MousePositionBinding(30, false, this); this.normalPressSwipeMousePosBinding = new MousePositionBinding(20, false, this); this.longPressSwipeMousePosBinding = new MousePositionBinding(20, false, this); this.normalPressSwipeDirBinding = new DirectionBinding(this); this.longPressSwipeDirBinding = new DirectionBinding(this); this.normalPressSwipeJoyBinding = new JoystickStateBinding(this); this.longPressSwipeJoyBinding = new JoystickStateBinding(this); }
// ---------------------- public void CopyFrom(AxisBinding b) { if (this.enabled = b.enabled) { this.Enable(); if (this.targetList.Count != b.targetList.Count) { this.targetList.Clear(); for (int i = 0; i < b.targetList.Count; ++i) { this.AddTarget(); } } for (int i = 0; i < b.targetList.Count; ++i) { this.targetList[i].CopyFrom(b.targetList[i]); } } }
// ------------------ public ScrollDeltaBinding(InputBindingBase parent = null) : base(parent) { this.deltaBinding = new AxisBinding(InputRig.DEFAULT_VERT_SCROLL_WHEEL_NAME, false, this); this.positiveDigitalBinding = new DigitalBinding(this); this.negativeDigitalBinding = new DigitalBinding(this); }