예제 #1
0
 public ControllerTriggerBinding(ControllerTrigger leftOrRight, float v)
 {
     side     = leftOrRight;
     position = v;
 }
예제 #2
0
 private void AddTriggerKeyBinding(ControllerTrigger controllerTrigger, float triggerValue, System.Windows.Forms.Keys keys, InputMode inputMode, CommandTarget commandTarget)
 {
     bindings.AddRange(ControllerInputBinding.createTriggerKeyBindings(controllerTrigger, triggerValue, keys, inputMode, commandTarget));
 }
예제 #3
0
        internal static IEnumerable <ControllerInputBinding> createTriggerKeyBindings(ControllerTrigger controllerTrigger, float triggerValue, System.Windows.Forms.Keys key, InputMode applicableMode, CommandTarget target)
        {
            ControllerInputBinding downResult = new ControllerInputBinding();

            downResult.trigger      = new ControllerTriggerBinding(controllerTrigger, triggerValue);
            downResult.triggerState = ControllerTriggerState.OnDown;
            KeyboardCommand newCommand = new KeyboardCommand();

            newCommand.key            = key;
            newCommand.commandState   = ButtonState.Down;
            newCommand.applicableMode = applicableMode;
            newCommand.target         = target;
            downResult.commands.Add(newCommand);

            ControllerInputBinding upResult = new ControllerInputBinding();

            upResult                  = new ControllerInputBinding();
            upResult.trigger          = new ControllerTriggerBinding(controllerTrigger, triggerValue);
            upResult.triggerState     = ControllerTriggerState.OnUp;
            upResult.buttonState      = ControllerButtonState.OnUp;
            newCommand                = new KeyboardCommand();
            newCommand.key            = key;
            newCommand.commandState   = ButtonState.Up;
            newCommand.applicableMode = applicableMode;
            newCommand.target         = target;
            upResult.commands.Add(newCommand);

            return(new ControllerInputBinding[2] {
                downResult, upResult
            });
        }