public ControllerTriggerBinding(ControllerTrigger leftOrRight, float v) { side = leftOrRight; position = v; }
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)); }
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 }); }