AddControl() public method

public AddControl ( InputControlType target, string handle, int player = -1 ) : InputControl
target InputControlType
handle string
player int
return InputControl
        void CreateDevice()
        {
            device = new TouchInputDevice();

            device.AddControl(InputControlType.LeftStickLeft, "LeftStickLeft");
            device.AddControl(InputControlType.LeftStickRight, "LeftStickRight");
            device.AddControl(InputControlType.LeftStickUp, "LeftStickUp");
            device.AddControl(InputControlType.LeftStickDown, "LeftStickDown");

            device.AddControl(InputControlType.RightStickLeft, "RightStickLeft");
            device.AddControl(InputControlType.RightStickRight, "RightStickRight");
            device.AddControl(InputControlType.RightStickUp, "RightStickUp");
            device.AddControl(InputControlType.RightStickDown, "RightStickDown");

            device.AddControl(InputControlType.DPadUp, "DPadUp");
            device.AddControl(InputControlType.DPadDown, "DPadDown");
            device.AddControl(InputControlType.DPadLeft, "DPadLeft");
            device.AddControl(InputControlType.DPadRight, "DPadRight");

            device.AddControl(InputControlType.LeftTrigger, "LeftTrigger");
            device.AddControl(InputControlType.RightTrigger, "RightTrigger");

            device.AddControl(InputControlType.LeftBumper, "LeftBumper");
            device.AddControl(InputControlType.RightBumper, "RightBumper");

            for (var control = InputControlType.Action1; control <= InputControlType.Action12; control++)
            {
                device.AddControl(control, control.ToString());
            }

            device.AddControl(InputControlType.Menu, "Menu");

            for (var control = InputControlType.Button0; control <= InputControlType.Button19; control++)
            {
                device.AddControl(control, control.ToString());
            }

            InputManager.AttachDevice(device);
        }
示例#2
0
        static void CreateDevice()
        {
            Device = new InputDevice("TouchDevice");

            Device.AddControl(InputControlType.LeftStickX, "LeftStickX");
            Device.AddControl(InputControlType.LeftStickY, "LeftStickY");
            Device.AddControl(InputControlType.RightStickX, "RightStickX");
            Device.AddControl(InputControlType.RightStickY, "RightStickY");
            Device.AddControl(InputControlType.LeftTrigger, "LeftTrigger");
            Device.AddControl(InputControlType.RightTrigger, "RightTrigger");
            Device.AddControl(InputControlType.DPadUp, "DPadUp");
            Device.AddControl(InputControlType.DPadDown, "DPadDown");
            Device.AddControl(InputControlType.DPadLeft, "DPadLeft");
            Device.AddControl(InputControlType.DPadRight, "DPadRight");
            Device.AddControl(InputControlType.Action1, "Action1");
            Device.AddControl(InputControlType.Action2, "Action2");
            Device.AddControl(InputControlType.Action3, "Action3");
            Device.AddControl(InputControlType.Action4, "Action4");
            Device.AddControl(InputControlType.LeftBumper, "LeftBumper");
            Device.AddControl(InputControlType.RightBumper, "RightBumper");
            Device.AddControl(InputControlType.Menu, "Menu");

            InputManager.AttachDevice(Device);
        }
示例#3
0
        void CreateDevice()
        {
            device = new InputDevice("TouchDevice");

            device.AddControl(InputControlType.LeftStickX, "LeftStickX");
            device.AddControl(InputControlType.LeftStickY, "LeftStickY");
            device.AddControl(InputControlType.RightStickX, "RightStickX");
            device.AddControl(InputControlType.RightStickY, "RightStickY");
            device.AddControl(InputControlType.LeftTrigger, "LeftTrigger");
            device.AddControl(InputControlType.RightTrigger, "RightTrigger");
            device.AddControl(InputControlType.DPadUp, "DPadUp");
            device.AddControl(InputControlType.DPadDown, "DPadDown");
            device.AddControl(InputControlType.DPadLeft, "DPadLeft");
            device.AddControl(InputControlType.DPadRight, "DPadRight");
            device.AddControl(InputControlType.Action1, "Action1");
            device.AddControl(InputControlType.Action2, "Action2");
            device.AddControl(InputControlType.Action3, "Action3");
            device.AddControl(InputControlType.Action4, "Action4");
            device.AddControl(InputControlType.LeftBumper, "LeftBumper");
            device.AddControl(InputControlType.RightBumper, "RightBumper");
            device.AddControl(InputControlType.Menu, "Menu");

            for (var control = InputControlType.Button0; control <= InputControlType.Button19; control++)
            {
                device.AddControl(control, control.ToString());
            }

            InputManager.AttachDevice(device);
        }
示例#4
0
 private void CreateDevice()
 {
     device = new TouchInputDevice();
     device.AddControl(InputControlType.LeftStickLeft, "LeftStickLeft");
     device.AddControl(InputControlType.LeftStickRight, "LeftStickRight");
     device.AddControl(InputControlType.LeftStickUp, "LeftStickUp");
     device.AddControl(InputControlType.LeftStickDown, "LeftStickDown");
     device.AddControl(InputControlType.RightStickLeft, "RightStickLeft");
     device.AddControl(InputControlType.RightStickRight, "RightStickRight");
     device.AddControl(InputControlType.RightStickUp, "RightStickUp");
     device.AddControl(InputControlType.RightStickDown, "RightStickDown");
     device.AddControl(InputControlType.DPadUp, "DPadUp");
     device.AddControl(InputControlType.DPadDown, "DPadDown");
     device.AddControl(InputControlType.DPadLeft, "DPadLeft");
     device.AddControl(InputControlType.DPadRight, "DPadRight");
     device.AddControl(InputControlType.LeftTrigger, "LeftTrigger");
     device.AddControl(InputControlType.RightTrigger, "RightTrigger");
     device.AddControl(InputControlType.LeftBumper, "LeftBumper");
     device.AddControl(InputControlType.RightBumper, "RightBumper");
     for (InputControlType inputControlType = InputControlType.Action1; inputControlType <= InputControlType.Action4; inputControlType++)
     {
         device.AddControl(inputControlType, inputControlType.ToString());
     }
     device.AddControl(InputControlType.Menu, "Menu");
     for (InputControlType inputControlType2 = InputControlType.Button0; inputControlType2 <= InputControlType.Button19; inputControlType2++)
     {
         device.AddControl(inputControlType2, inputControlType2.ToString());
     }
     InputManager.AttachDevice(device);
 }