Exemplo n.º 1
0
 public void OnUnpairedInputDeviceUsed(Inputs.InputControl control)
 {
     if (control.device is Inputs.Gamepad)
     {
         //for(var i = 0; i < _users.Length; i++)
         //{
         //    // find a user without a paired device
         //    if (_users[i].pairedDevices.Count == 0)
         //    {
         //        // pair the new Gamepad device to that user
         //        _users[i] = InputUser.PerformPairingWithDevice(control.device, _users[i]);
         //        return;
         //    }
         //}
     }
     else if (control.device is Inputs.Keyboard)
     {
     }
 }
Exemplo n.º 2
0
 bool IInputStateCallbackReceiver.GetStateOffsetForEvent(InputControl control, InputEventPtr eventPtr, ref uint offset)
 {
     return(false);
 }
Exemplo n.º 3
0
 public abstract unsafe void Process(void *buffer, int bufferSize, InputControl control);
Exemplo n.º 4
0
 public ActionConstraint Canceled(InputAction action, InputControl control = null, double?time = null, double?duration = null)
 {
     return(new ActionConstraint(InputActionPhase.Canceled, action, control, time: time, duration: duration));
 }
Exemplo n.º 5
0
 public ActionConstraint Canceled <TInteraction>(InputAction action, InputControl control = null, object value = null, double?time = null, double?duration = null)
     where TInteraction : IInputInteraction
 {
     return(new ActionConstraint(InputActionPhase.Canceled, action, control, interaction: typeof(TInteraction), time: time,
                                 duration: duration, value: value));
 }
Exemplo n.º 6
0
 public ActionConstraint Performed <TValue>(InputAction action, InputControl <TValue> control, TValue value, double?time = null)
     where TValue : struct
 {
     return(new ActionConstraint(InputActionPhase.Performed, action, control, value, time: time));
 }
Exemplo n.º 7
0
 public ActionConstraint Performed(InputAction action, InputControl control = null, double?time = null, double?duration = null, object value = null)
 {
     return(new ActionConstraint(InputActionPhase.Performed, action, control, time: time, duration: duration, value: value));
 }
Exemplo n.º 8
0
        private UnityEngine.InputSystem.Controls.Vector2Control Initialize_ctrlMousescroll(InternedString kVector2Layout, InputControl parent)
        {
            var ctrlMousescroll = new UnityEngine.InputSystem.Controls.Vector2Control();

            ctrlMousescroll.Setup()
            .At(this, 2)
            .WithParent(parent)
            .WithChildren(17, 2)
            .WithName("scroll")
            .WithDisplayName("Scroll")
            .WithLayout(kVector2Layout)
            .WithStateBlock(new InputStateBlock
            {
                format     = new FourCC(1447379762),
                byteOffset = 16,
                bitOffset  = 0,
                sizeInBits = 64
            })
            .Finish();
            return(ctrlMousescroll);
        }
Exemplo n.º 9
0
        private UnityEngine.InputSystem.Controls.ButtonControl Initialize_ctrlMousepress(InternedString kButtonLayout, InputControl parent)
        {
            var ctrlMousepress = new UnityEngine.InputSystem.Controls.ButtonControl();

            ctrlMousepress.Setup()
            .At(this, 3)
            .WithParent(parent)
            .WithName("press")
            .WithDisplayName("Press")
            .WithLayout(kButtonLayout)
            .IsSynthetic(true)
            .IsButton(true)
            .WithStateBlock(new InputStateBlock
            {
                format     = new FourCC(1112101920),
                byteOffset = 24,
                bitOffset  = 0,
                sizeInBits = 1
            })
            .WithMinAndMax(0, 1)
            .Finish();
            return(ctrlMousepress);
        }
Exemplo n.º 10
0
        private UnityEngine.InputSystem.Controls.AxisControl Initialize_ctrlMousescrollright(InternedString kAxisLayout, InputControl parent)
        {
            var ctrlMousescrollright = new UnityEngine.InputSystem.Controls.AxisControl {
                clamp = UnityEngine.InputSystem.Controls.AxisControl.Clamp.BeforeNormalize, clampMax = 3.402823E+38f
            };

            ctrlMousescrollright.Setup()
            .At(this, 24)
            .WithParent(parent)
            .WithName("right")
            .WithDisplayName("Scroll Right")
            .WithShortDisplayName("Scroll Right")
            .WithLayout(kAxisLayout)
            .IsSynthetic(true)
            .WithStateBlock(new InputStateBlock
            {
                format     = new FourCC(1179407392),
                byteOffset = 16,
                bitOffset  = 0,
                sizeInBits = 32
            })
            .Finish();
            return(ctrlMousescrollright);
        }
Exemplo n.º 11
0
        private UnityEngine.InputSystem.Controls.Vector2Control Initialize_ctrlMouseposition(InternedString kVector2Layout, InputControl parent)
        {
            var ctrlMouseposition = new UnityEngine.InputSystem.Controls.Vector2Control();

            ctrlMouseposition.Setup()
            .At(this, 0)
            .WithParent(parent)
            .WithChildren(13, 2)
            .WithName("position")
            .WithDisplayName("Position")
            .WithLayout(kVector2Layout)
            .WithUsages(0, 1)
            .WithStateBlock(new InputStateBlock
            {
                format     = new FourCC(1447379762),
                byteOffset = 0,
                bitOffset  = 0,
                sizeInBits = 64
            })
                #if UNITY_EDITOR
            .WithProcessor <InputProcessor <UnityEngine.Vector2>, UnityEngine.Vector2>(new UnityEngine.InputSystem.Processors.EditorWindowSpaceProcessor())
                #endif
            .Finish();
            return(ctrlMouseposition);
        }
Exemplo n.º 12
0
        private UnityEngine.InputSystem.Controls.AxisControl Initialize_ctrlMousedeltaleft(InternedString kAxisLayout, InputControl parent)
        {
            var ctrlMousedeltaleft = new UnityEngine.InputSystem.Controls.AxisControl {
                clamp = UnityEngine.InputSystem.Controls.AxisControl.Clamp.BeforeNormalize, clampMin = -3.402823E+38f, invert = true
            };

            ctrlMousedeltaleft.Setup()
            .At(this, 17)
            .WithParent(parent)
            .WithName("left")
            .WithDisplayName("Delta Left")
            .WithShortDisplayName("Delta Left")
            .WithLayout(kAxisLayout)
            .IsSynthetic(true)
            .WithStateBlock(new InputStateBlock
            {
                format     = new FourCC(1179407392),
                byteOffset = 8,
                bitOffset  = 0,
                sizeInBits = 32
            })
            .Finish();
            return(ctrlMousedeltaleft);
        }
Exemplo n.º 13
0
        private UnityEngine.InputSystem.Controls.AxisControl Initialize_ctrlMousepositionx(InternedString kAxisLayout, InputControl parent)
        {
            var ctrlMousepositionx = new UnityEngine.InputSystem.Controls.AxisControl();

            ctrlMousepositionx.Setup()
            .At(this, 13)
            .WithParent(parent)
            .WithName("x")
            .WithDisplayName("Position X")
            .WithShortDisplayName("Position X")
            .WithLayout(kAxisLayout)
            .DontReset(true)
            .WithStateBlock(new InputStateBlock
            {
                format     = new FourCC(1179407392),
                byteOffset = 0,
                bitOffset  = 0,
                sizeInBits = 32
            })
            .Finish();
            return(ctrlMousepositionx);
        }
Exemplo n.º 14
0
        private UnityEngine.InputSystem.Controls.DeltaControl Initialize_ctrlMousedelta(InternedString kDeltaLayout, InputControl parent)
        {
            var ctrlMousedelta = new UnityEngine.InputSystem.Controls.DeltaControl();

            ctrlMousedelta.Setup()
            .At(this, 1)
            .WithParent(parent)
            .WithChildren(15, 6)
            .WithName("delta")
            .WithDisplayName("Delta")
            .WithLayout(kDeltaLayout)
            .WithUsages(1, 1)
            .WithStateBlock(new InputStateBlock
            {
                format     = new FourCC(1447379762),
                byteOffset = 8,
                bitOffset  = 0,
                sizeInBits = 64
            })
            .Finish();
            return(ctrlMousedelta);
        }
Exemplo n.º 15
0
        private UnityEngine.InputSystem.Controls.AxisControl Initialize_ctrlMouseradiusy(InternedString kAxisLayout, InputControl parent)
        {
            var ctrlMouseradiusy = new UnityEngine.InputSystem.Controls.AxisControl();

            ctrlMouseradiusy.Setup()
            .At(this, 20)
            .WithParent(parent)
            .WithName("y")
            .WithDisplayName("Radius Y")
            .WithShortDisplayName("Radius Y")
            .WithLayout(kAxisLayout)
            .WithStateBlock(new InputStateBlock
            {
                format     = new FourCC(1179407392),
                byteOffset = 44,
                bitOffset  = 0,
                sizeInBits = 32
            })
            .Finish();
            return(ctrlMouseradiusy);
        }
Exemplo n.º 16
0
        private UnityEngine.InputSystem.Controls.ButtonControl Initialize_ctrlMousebackButton(InternedString kButtonLayout, InputControl parent)
        {
            var ctrlMousebackButton = new UnityEngine.InputSystem.Controls.ButtonControl();

            ctrlMousebackButton.Setup()
            .At(this, 8)
            .WithParent(parent)
            .WithName("backButton")
            .WithDisplayName("Back")
            .WithLayout(kButtonLayout)
            .WithUsages(7, 1)
            .IsButton(true)
            .WithStateBlock(new InputStateBlock
            {
                format     = new FourCC(1112101920),
                byteOffset = 24,
                bitOffset  = 4,
                sizeInBits = 1
            })
            .WithMinAndMax(0, 1)
            .Finish();
            return(ctrlMousebackButton);
        }
Exemplo n.º 17
0
 public ActionConstraint Performed(InputAction action, InputControl control = null, double?time = null)
 {
     return(new ActionConstraint(InputActionPhase.Performed, action, control, time: time));
 }
Exemplo n.º 18
0
        private UnityEngine.InputSystem.Controls.AxisControl Initialize_ctrlMousepressure(InternedString kAxisLayout, InputControl parent)
        {
            var ctrlMousepressure = new UnityEngine.InputSystem.Controls.AxisControl();

            ctrlMousepressure.Setup()
            .At(this, 9)
            .WithParent(parent)
            .WithName("pressure")
            .WithDisplayName("Pressure")
            .WithLayout(kAxisLayout)
            .WithUsages(8, 1)
            .WithStateBlock(new InputStateBlock
            {
                format     = new FourCC(1179407392),
                byteOffset = 32,
                bitOffset  = 0,
                sizeInBits = 32
            })
            .WithDefaultState(1)
            .Finish();
            return(ctrlMousepressure);
        }
Exemplo n.º 19
0
 public ActionConstraint Performed <TInteraction>(InputAction action, InputControl control = null, double?time = null)
     where TInteraction : IInputInteraction
 {
     return(new ActionConstraint(InputActionPhase.Performed, action, control, interaction: typeof(TInteraction), time: time));
 }
Exemplo n.º 20
0
        private UnityEngine.InputSystem.Controls.Vector2Control Initialize_ctrlMouseradius(InternedString kVector2Layout, InputControl parent)
        {
            var ctrlMouseradius = new UnityEngine.InputSystem.Controls.Vector2Control();

            ctrlMouseradius.Setup()
            .At(this, 10)
            .WithParent(parent)
            .WithChildren(19, 2)
            .WithName("radius")
            .WithDisplayName("Radius")
            .WithLayout(kVector2Layout)
            .WithUsages(9, 1)
            .WithStateBlock(new InputStateBlock
            {
                format     = new FourCC(1447379762),
                byteOffset = 40,
                bitOffset  = 0,
                sizeInBits = 64
            })
            .Finish();
            return(ctrlMouseradius);
        }
Exemplo n.º 21
0
 public ActionConstraint Started(InputAction action, InputControl control = null, double?time = null)
 {
     return(new ActionConstraint(InputActionPhase.Started, action, control, time: time, duration: 0));
 }
Exemplo n.º 22
0
        private UnityEngine.InputSystem.Controls.IntegerControl Initialize_ctrlMousepointerId(InternedString kDigitalLayout, InputControl parent)
        {
            var ctrlMousepointerId = new UnityEngine.InputSystem.Controls.IntegerControl();

            ctrlMousepointerId.Setup()
            .At(this, 11)
            .WithParent(parent)
            .WithName("pointerId")
            .WithDisplayName("pointerId")
            .WithLayout(kDigitalLayout)
            .WithStateBlock(new InputStateBlock
            {
                format     = new FourCC(1112101920),
                byteOffset = 48,
                bitOffset  = 0,
                sizeInBits = 1
            })
            .Finish();
            return(ctrlMousepointerId);
        }
Exemplo n.º 23
0
 public ActionConstraint Canceled <TValue>(InputAction action, InputControl <TValue> control, TValue value, double?time = null, double?duration = null)
     where TValue : struct
 {
     return(new ActionConstraint(InputActionPhase.Canceled, action, control, value, time: time, duration: duration));
 }
Exemplo n.º 24
0
        private UnityEngine.InputSystem.Controls.IntegerControl Initialize_ctrlMouseclickCount(InternedString kIntegerLayout, InputControl parent)
        {
            var ctrlMouseclickCount = new UnityEngine.InputSystem.Controls.IntegerControl();

            ctrlMouseclickCount.Setup()
            .At(this, 12)
            .WithParent(parent)
            .WithName("clickCount")
            .WithDisplayName("Click Count")
            .WithLayout(kIntegerLayout)
            .IsSynthetic(true)
            .WithStateBlock(new InputStateBlock
            {
                format     = new FourCC(1431521364),
                byteOffset = 28,
                bitOffset  = 0,
                sizeInBits = 16
            })
            .Finish();
            return(ctrlMouseclickCount);
        }
Exemplo n.º 25
0
 public void Trigger <TValue>(InputAction action, InputControl <TValue> control, TValue value)
     where TValue : struct
 {
     throw new NotImplementedException();
 }
Exemplo n.º 26
0
        private UnityEngine.InputSystem.Controls.AxisControl Initialize_ctrlMousescrollx(InternedString kAxisLayout, InputControl parent)
        {
            var ctrlMousescrollx = new UnityEngine.InputSystem.Controls.AxisControl();

            ctrlMousescrollx.Setup()
            .At(this, 17)
            .WithParent(parent)
            .WithName("x")
            .WithDisplayName("Scroll Left/Right")
            .WithShortDisplayName("Scroll Left/Right")
            .WithLayout(kAxisLayout)
            .WithUsages(2, 1)
            .WithAliases(0, 1)
            .WithStateBlock(new InputStateBlock
            {
                format     = new FourCC(1179407392),
                byteOffset = 16,
                bitOffset  = 0,
                sizeInBits = 32
            })
            .Finish();
            return(ctrlMousescrollx);
        }
Exemplo n.º 27
0
 /// <summary>
 /// Process an input value, given as an object, and return the processed value as an object.
 /// </summary>
 /// <param name="value">A value of type <see cref="valueType"/>.</param>
 /// <param name="control">Optional control that the value originated from. Must have the same value type
 /// that the processor has (<see cref="valueType"/>).</param>
 /// <returns>A processed value based on <paramref name="value"/>.</returns>
 /// <remarks>
 /// This method allocates GC memory. To process values without allocating GC memory, it is necessary to know
 /// the value type of a processor at compile time and call <see cref="InputProcessor{TValue}.Process"/> directly.
 /// </remarks>
 public abstract object ProcessAsObject(object value, InputControl control);
Exemplo n.º 28
0
        private UnityEngine.InputSystem.Controls.AxisControl Initialize_ctrlMousescrolly(InternedString kAxisLayout, InputControl parent)
        {
            var ctrlMousescrolly = new UnityEngine.InputSystem.Controls.AxisControl();

            ctrlMousescrolly.Setup()
            .At(this, 18)
            .WithParent(parent)
            .WithName("y")
            .WithDisplayName("Scroll Up/Down")
            .WithShortDisplayName("Scroll Wheel")
            .WithLayout(kAxisLayout)
            .WithUsages(3, 1)
            .WithAliases(1, 1)
            .WithStateBlock(new InputStateBlock
            {
                format     = new FourCC(1179407392),
                byteOffset = 20,
                bitOffset  = 0,
                sizeInBits = 32
            })
            .Finish();
            return(ctrlMousescrolly);
        }
Exemplo n.º 29
0
 private void InputUser_onUnpairedDeviceUsed(UnityEngine.InputSystem.InputControl control, UnityEngine.InputSystem.LowLevel.InputEventPtr arg2)
 {
     Debug.Log($"using device {control.device.name}");
 }
        public static int ApplyBindingOverridesOnMatchingControls(this InputActionMap actionMap, InputControl control)
        {
            if (actionMap == null)
            {
                throw new ArgumentNullException(nameof(actionMap));
            }
            if (control == null)
            {
                throw new ArgumentNullException(nameof(control));
            }

            var actions             = actionMap.actions;
            var actionCount         = actions.Count;
            var numMatchingControls = 0;

            for (var i = 0; i < actionCount; ++i)
            {
                var action = actions[i];
                numMatchingControls = action.ApplyBindingOverridesOnMatchingControls(control);
            }

            return(numMatchingControls);
        }