Example #1
0
        protected override void FinishSetup(InputDeviceBuilder builder)
        {
            var buttons = new List <ButtonControl>();
            var axes    = new List <AxisControl>();

            FindControlsRecursive(this, buttons, x => !(x.parent is StickControl) && !(x.parent is DpadControl));
            FindControlsRecursive(this, axes, x => !(x is ButtonControl));

            if (buttons.Count > 0)
            {
                m_Buttons = buttons.ToArray();
            }
            if (axes.Count > 0)
            {
                m_Axes = axes.ToArray();
            }

            // Mandatory controls.
            trigger = builder.GetControl <ButtonControl>("{PrimaryTrigger}");
            stick   = builder.GetControl <StickControl>("{Primary2DMotion}");

            // Optional controls.
            twist = builder.TryGetControl <AxisControl>("{Twist}");
            hat   = builder.TryGetControl <DpadControl>("{Hatswitch}");

            base.FinishSetup(builder);
        }
Example #2
0
 protected override void FinishSetup(InputDeviceBuilder builder)
 {
     tip                = builder.GetControl <ButtonControl>("tip");
     eraser             = builder.GetControl <ButtonControl>("eraser");
     firstBarrelButton  = builder.GetControl <ButtonControl>("barrelFirst");
     secondBarrelButton = builder.GetControl <ButtonControl>("barrelSecond");
     base.FinishSetup(builder);
 }
Example #3
0
 protected override void FinishSetup(InputDeviceBuilder builder)
 {
     scroll       = builder.GetControl <Vector2Control>(this, "scroll");
     leftButton   = builder.GetControl <ButtonControl>(this, "leftButton");
     middleButton = builder.GetControl <ButtonControl>(this, "middleButton");
     rightButton  = builder.GetControl <ButtonControl>(this, "rightButton");
     base.FinishSetup(builder);
 }
Example #4
0
        protected override void FinishSetup(InputDeviceBuilder builder)
        {
            // Mandatory controls.
            trigger = builder.GetControl <ButtonControl>("{PrimaryTrigger}");
            stick   = builder.GetControl <StickControl>("{Primary2DMotion}");

            // Optional controls.
            twist = builder.TryGetControl <AxisControl>("{Twist}");
            hat   = builder.TryGetControl <DpadControl>("{Hatswitch}");

            base.FinishSetup(builder);
        }
Example #5
0
        protected override void FinishSetup(InputDeviceBuilder builder)
        {
            position     = builder.GetControl <Vector2Control>(this, "position");
            delta        = builder.GetControl <Vector2Control>(this, "delta");
            tilt         = builder.GetControl <Vector2Control>(this, "tilt");
            radius       = builder.GetControl <Vector2Control>(this, "radius");
            pressure     = builder.GetControl <AxisControl>(this, "pressure");
            twist        = builder.GetControl <AxisControl>(this, "twist");
            pointerId    = builder.GetControl <IntegerControl>(this, "pointerId");
            phase        = builder.GetControl <PointerPhaseControl>(this, "phase");
            displayIndex = builder.GetControl <IntegerControl>(this, "displayIndex");
            button       = builder.GetControl <ButtonControl>(this, "button");

            base.FinishSetup(builder);
        }
Example #6
0
 protected override void FinishSetup(InputDeviceBuilder builder)
 {
     tip                = builder.GetControl <ButtonControl>("tip");
     eraser             = builder.GetControl <ButtonControl>("eraser");
     firstBarrelButton  = builder.GetControl <ButtonControl>("barrel1");
     secondBarrelButton = builder.GetControl <ButtonControl>("barrel2");
     thirdBarrelButton  = builder.GetControl <ButtonControl>("barrel3");
     fourthBarrelButton = builder.GetControl <ButtonControl>("barrel4");
     inRange            = builder.GetControl <ButtonControl>("inRange");
     base.FinishSetup(builder);
 }
Example #7
0
 protected override void FinishSetup(InputDeviceBuilder builder)
 {
     scroll        = builder.GetControl <Vector2Control>(this, "scroll");
     leftButton    = builder.GetControl <ButtonControl>(this, "leftButton");
     middleButton  = builder.GetControl <ButtonControl>(this, "middleButton");
     rightButton   = builder.GetControl <ButtonControl>(this, "rightButton");
     forwardButton = builder.GetControl <ButtonControl>(this, "forwardButton");
     backButton    = builder.GetControl <ButtonControl>(this, "backButton");
     clickCount    = builder.GetControl <IntegerControl>(this, "clickCount");
     base.FinishSetup(builder);
 }
Example #8
0
        protected override void FinishSetup(InputDeviceBuilder builder)
        {
            var touchArray = new TouchControl[TouchscreenState.kMaxTouches];

            for (var i = 0; i < TouchscreenState.kMaxTouches; ++i)
            {
                touchArray[i] = builder.GetControl <TouchControl>(this, "touch" + i);
            }

            allTouchControls     = new ReadOnlyArray <TouchControl>(touchArray);
            m_ActiveTouchesArray = new TouchControl[TouchscreenState.kMaxTouches];

            base.FinishSetup(builder);
        }
Example #9
0
 protected override void FinishSetup(InputDeviceBuilder builder)
 {
     acceleration = builder.GetControl <Vector3Control>("acceleration");
     base.FinishSetup(builder);
 }
Example #10
0
 protected override void FinishSetup(InputDeviceBuilder builder)
 {
     attitude = builder.GetControl <QuaternionControl>("attitude");
     base.FinishSetup(builder);
 }
Example #11
0
 protected override void FinishSetup(InputDeviceBuilder builder)
 {
     gravity = builder.GetControl <Vector3Control>("gravity");
     base.FinishSetup(builder);
 }
Example #12
0
 protected override void FinishSetup(InputDeviceBuilder builder)
 {
     angularVelocity = builder.GetControl <Vector3Control>("angularVelocity");
     base.FinishSetup(builder);
 }
Example #13
0
        protected override void FinishSetup(InputDeviceBuilder builder)
        {
            buttonWest  = builder.GetControl <ButtonControl>(this, "buttonWest");
            buttonNorth = builder.GetControl <ButtonControl>(this, "buttonNorth");
            buttonSouth = builder.GetControl <ButtonControl>(this, "buttonSouth");
            buttonEast  = builder.GetControl <ButtonControl>(this, "buttonEast");

            startButton  = builder.GetControl <ButtonControl>(this, "start");
            selectButton = builder.GetControl <ButtonControl>(this, "select");

            leftStickButton  = builder.GetControl <ButtonControl>(this, "leftStickPress");
            rightStickButton = builder.GetControl <ButtonControl>(this, "rightStickPress");

            dpad = builder.GetControl <DpadControl>(this, "dpad");

            leftShoulder  = builder.GetControl <ButtonControl>(this, "leftShoulder");
            rightShoulder = builder.GetControl <ButtonControl>(this, "rightShoulder");

            leftStick  = builder.GetControl <StickControl>(this, "leftStick");
            rightStick = builder.GetControl <StickControl>(this, "rightStick");

            leftTrigger  = builder.GetControl <ButtonControl>(this, "leftTrigger");
            rightTrigger = builder.GetControl <ButtonControl>(this, "rightTrigger");

            base.FinishSetup(builder);
        }
Example #14
0
 protected override void FinishSetup(InputDeviceBuilder builder)
 {
     lightLevel = builder.GetControl <AxisControl>("lightLevel");
     base.FinishSetup(builder);
 }
Example #15
0
 protected override void FinishSetup(InputDeviceBuilder builder)
 {
     atmosphericPressure = builder.GetControl <AxisControl>("atmosphericPressure");
     base.FinishSetup(builder);
 }
Example #16
0
 protected override void FinishSetup(InputDeviceBuilder builder)
 {
     distance = builder.GetControl <AxisControl>("distance");
     base.FinishSetup(builder);
 }
Example #17
0
        protected override void FinishSetup(InputDeviceBuilder builder)
        {
            var keyStrings = new[]
            {
                "space",
                "enter",
                "tab",
                "backquote",
                "quote",
                "semicolon",
                "comma",
                "period",
                "slash",
                "backslash",
                "leftbracket",
                "rightbracket",
                "minus",
                "equals",
                "a",
                "b",
                "c",
                "d",
                "e",
                "f",
                "g",
                "h",
                "i",
                "j",
                "k",
                "l",
                "m",
                "n",
                "o",
                "p",
                "q",
                "r",
                "s",
                "t",
                "u",
                "v",
                "w",
                "x",
                "y",
                "z",
                "1",
                "2",
                "3",
                "4",
                "5",
                "6",
                "7",
                "8",
                "9",
                "0",
                "leftshift",
                "rightshift",
                "leftalt",
                "rightalt",
                "leftctrl",
                "rightctrl",
                "leftmeta",
                "rightmeta",
                "contextmenu",
                "escape",
                "leftarrow",
                "rightarrow",
                "uparrow",
                "downarrow",
                "backspace",
                "pagedown",
                "pageup",
                "home",
                "end",
                "insert",
                "delete",
                "capslock",
                "numlock",
                "printscreen",
                "scrolllock",
                "pause",
                "numpadenter",
                "numpaddivide",
                "numpadmultiply",
                "numpadplus",
                "numpadminus",
                "numpadperiod",
                "numpadequals",
                "numpad0",
                "numpad1",
                "numpad2",
                "numpad3",
                "numpad4",
                "numpad5",
                "numpad6",
                "numpad7",
                "numpad8",
                "numpad9",
                "f1",
                "f2",
                "f3",
                "f4",
                "f5",
                "f6",
                "f7",
                "f8",
                "f9",
                "f10",
                "f11",
                "f12",
                "oem1",
                "oem2",
                "oem3",
                "oem4",
                "oem5",
            };

            m_Keys = new KeyControl[keyStrings.Length];
            for (var i = 1; i < keyStrings.Length; i++)
            {
                m_Keys[i] = builder.GetControl <KeyControl>(keyStrings[i - 1]);

                ////REVIEW: Ideally, we'd have a way to do this through layouts; this way nested key controls could work, too,
                ////        and it just seems somewhat dirty to jam the data into the control here
                m_Keys[i].keyCode = (Key)i;
            }
            Debug.Assert(keyStrings[((int)Key.OEM5) - 1] == "oem5", "keyString array layout doe not match Key enum layout");
            anyKey      = builder.GetControl <AnyKeyControl>("anyKey");
            imeSelected = builder.GetControl <ButtonControl>("IMESelected");

            base.FinishSetup(builder);
        }
Example #18
0
 protected override void FinishSetup(InputDeviceBuilder builder)
 {
     stepCounter = builder.GetControl <IntegerControl>("stepCounter");
     base.FinishSetup(builder);
 }
Example #19
0
 protected override void FinishSetup(InputDeviceBuilder builder)
 {
     ambientTemperature = builder.GetControl <AxisControl>("ambientTemperature");
     base.FinishSetup(builder);
 }
Example #20
0
 protected override void FinishSetup(InputDeviceBuilder builder)
 {
     relativeHumidity = builder.GetControl <AxisControl>("relativeHumidity");
     base.FinishSetup(builder);
 }
Example #21
0
        protected override void FinishSetup(InputDeviceBuilder builder)
        {
            anyKey            = builder.GetControl <AnyKeyControl>("anyKey");
            spaceKey          = builder.GetControl <KeyControl>("space");
            enterKey          = builder.GetControl <KeyControl>("enter");
            tabKey            = builder.GetControl <KeyControl>("tab");
            backquoteKey      = builder.GetControl <KeyControl>("backquote");
            quoteKey          = builder.GetControl <KeyControl>("quote");
            semicolonKey      = builder.GetControl <KeyControl>("semicolon");
            commaKey          = builder.GetControl <KeyControl>("comma");
            periodKey         = builder.GetControl <KeyControl>("period");
            slashKey          = builder.GetControl <KeyControl>("slash");
            backslashKey      = builder.GetControl <KeyControl>("backslash");
            leftBracketKey    = builder.GetControl <KeyControl>("leftBracket");
            rightBracketKey   = builder.GetControl <KeyControl>("rightBracket");
            minusKey          = builder.GetControl <KeyControl>("minus");
            equalsKey         = builder.GetControl <KeyControl>("equals");
            aKey              = builder.GetControl <KeyControl>("a");
            bKey              = builder.GetControl <KeyControl>("b");
            cKey              = builder.GetControl <KeyControl>("c");
            dKey              = builder.GetControl <KeyControl>("d");
            eKey              = builder.GetControl <KeyControl>("e");
            fKey              = builder.GetControl <KeyControl>("f");
            gKey              = builder.GetControl <KeyControl>("g");
            hKey              = builder.GetControl <KeyControl>("h");
            iKey              = builder.GetControl <KeyControl>("i");
            jKey              = builder.GetControl <KeyControl>("j");
            kKey              = builder.GetControl <KeyControl>("k");
            lKey              = builder.GetControl <KeyControl>("l");
            mKey              = builder.GetControl <KeyControl>("m");
            nKey              = builder.GetControl <KeyControl>("n");
            oKey              = builder.GetControl <KeyControl>("o");
            pKey              = builder.GetControl <KeyControl>("p");
            qKey              = builder.GetControl <KeyControl>("q");
            rKey              = builder.GetControl <KeyControl>("r");
            sKey              = builder.GetControl <KeyControl>("s");
            tKey              = builder.GetControl <KeyControl>("t");
            uKey              = builder.GetControl <KeyControl>("u");
            vKey              = builder.GetControl <KeyControl>("v");
            wKey              = builder.GetControl <KeyControl>("w");
            xKey              = builder.GetControl <KeyControl>("x");
            yKey              = builder.GetControl <KeyControl>("y");
            zKey              = builder.GetControl <KeyControl>("z");
            digit1Key         = builder.GetControl <KeyControl>("1");
            digit2Key         = builder.GetControl <KeyControl>("2");
            digit3Key         = builder.GetControl <KeyControl>("3");
            digit4Key         = builder.GetControl <KeyControl>("4");
            digit5Key         = builder.GetControl <KeyControl>("5");
            digit6Key         = builder.GetControl <KeyControl>("6");
            digit7Key         = builder.GetControl <KeyControl>("7");
            digit8Key         = builder.GetControl <KeyControl>("8");
            digit9Key         = builder.GetControl <KeyControl>("9");
            digit0Key         = builder.GetControl <KeyControl>("0");
            leftShiftKey      = builder.GetControl <KeyControl>("leftShift");
            rightShiftKey     = builder.GetControl <KeyControl>("rightShift");
            leftAltKey        = builder.GetControl <KeyControl>("leftAlt");
            rightAltKey       = builder.GetControl <KeyControl>("rightAlt");
            leftCtrlKey       = builder.GetControl <KeyControl>("leftCtrl");
            rightCtrlKey      = builder.GetControl <KeyControl>("rightCtrl");
            leftMetaKey       = builder.GetControl <KeyControl>("leftMeta");
            rightMetaKey      = builder.GetControl <KeyControl>("rightMeta");
            leftWindowsKey    = builder.GetControl <KeyControl>("leftWindows");
            rightWindowsKey   = builder.GetControl <KeyControl>("rightWindows");
            leftAppleKey      = builder.GetControl <KeyControl>("leftApple");
            rightAppleKey     = builder.GetControl <KeyControl>("rightApple");
            leftCommandKey    = builder.GetControl <KeyControl>("leftCommand");
            rightCommandKey   = builder.GetControl <KeyControl>("rightCommand");
            contextMenuKey    = builder.GetControl <KeyControl>("contextMenu");
            escapeKey         = builder.GetControl <KeyControl>("escape");
            leftArrowKey      = builder.GetControl <KeyControl>("leftArrow");
            rightArrowKey     = builder.GetControl <KeyControl>("rightArrow");
            upArrowKey        = builder.GetControl <KeyControl>("upArrow");
            downArrowKey      = builder.GetControl <KeyControl>("downArrow");
            backspaceKey      = builder.GetControl <KeyControl>("backspace");
            pageDownKey       = builder.GetControl <KeyControl>("pageDown");
            pageUpKey         = builder.GetControl <KeyControl>("pageUp");
            homeKey           = builder.GetControl <KeyControl>("home");
            endKey            = builder.GetControl <KeyControl>("end");
            insertKey         = builder.GetControl <KeyControl>("insert");
            deleteKey         = builder.GetControl <KeyControl>("delete");
            numpadEnterKey    = builder.GetControl <KeyControl>("numpadEnter");
            numpadDivideKey   = builder.GetControl <KeyControl>("numpadDivide");
            numpadMultiplyKey = builder.GetControl <KeyControl>("numpadMultiply");
            numpadPlusKey     = builder.GetControl <KeyControl>("numpadPlus");
            numpadMinusKey    = builder.GetControl <KeyControl>("numpadMinus");
            numpadPeriodKey   = builder.GetControl <KeyControl>("numpadPeriod");
            numpadEqualsKey   = builder.GetControl <KeyControl>("numpadEquals");
            numpad0Key        = builder.GetControl <KeyControl>("numpad0");
            numpad1Key        = builder.GetControl <KeyControl>("numpad1");
            numpad2Key        = builder.GetControl <KeyControl>("numpad2");
            numpad3Key        = builder.GetControl <KeyControl>("numpad3");
            numpad4Key        = builder.GetControl <KeyControl>("numpad4");
            numpad5Key        = builder.GetControl <KeyControl>("numpad5");
            numpad6Key        = builder.GetControl <KeyControl>("numpad6");
            numpad7Key        = builder.GetControl <KeyControl>("numpad7");
            numpad8Key        = builder.GetControl <KeyControl>("numpad8");
            numpad9Key        = builder.GetControl <KeyControl>("numpad9");
            f1Key             = builder.GetControl <KeyControl>("f1");
            f2Key             = builder.GetControl <KeyControl>("f2");
            f3Key             = builder.GetControl <KeyControl>("f3");
            f4Key             = builder.GetControl <KeyControl>("f4");
            f5Key             = builder.GetControl <KeyControl>("f5");
            f6Key             = builder.GetControl <KeyControl>("f6");
            f7Key             = builder.GetControl <KeyControl>("f7");
            f8Key             = builder.GetControl <KeyControl>("f8");
            f9Key             = builder.GetControl <KeyControl>("f9");
            f10Key            = builder.GetControl <KeyControl>("f10");
            f11Key            = builder.GetControl <KeyControl>("f11");
            f12Key            = builder.GetControl <KeyControl>("f12");
            capsLockKey       = builder.GetControl <KeyControl>("capsLock");
            numLockKey        = builder.GetControl <KeyControl>("numLock");
            scrollLockKey     = builder.GetControl <KeyControl>("scrollLock");
            printScreenKey    = builder.GetControl <KeyControl>("printScreen");
            pauseKey          = builder.GetControl <KeyControl>("pause");
            oem1Key           = builder.GetControl <KeyControl>("OEM1");
            oem2Key           = builder.GetControl <KeyControl>("OEM2");
            oem3Key           = builder.GetControl <KeyControl>("OEM3");
            oem4Key           = builder.GetControl <KeyControl>("OEM4");
            oem5Key           = builder.GetControl <KeyControl>("OEM5");

            imeSelected = builder.GetControl <ButtonControl>("IMESelected");

            ////REVIEW: Ideally, we'd have a way to do this through layouts; this way nested key controls could work, too,
            ////        and it just seems somewhat dirty to jam the data into the control here

            // Assign key code to all keys.
            for (var key = 1; key < (int)Keyboard.KeyCount; ++key)
            {
                this[(Key)key].keyCode = (Key)key;
            }

            base.FinishSetup(builder);
        }
Example #22
0
 protected override void FinishSetup(InputDeviceBuilder builder)
 {
     magneticField = builder.GetControl <Vector3Control>("magneticField");
     base.FinishSetup(builder);
 }