public IPhysicalButton ConfigureButton(IPhysicalButton button, int pin) { button.Initialize(pin); button.Click += ButtonClick; button.Held += ButtonHeld; return(button); }
public static void SetOn(Control control, IPhysicalButton physicalButton) { if (control == null) { throw new ArgumentNullException(nameof(control)); } if (physicalButton == null) { throw new ArgumentNullException(nameof(physicalButton)); } control._currentState = true; control._physicalButton = physicalButton; physicalButton.Used = true; }
public bool IsPressed(IPhysicalButton pb) { switch (pb.Input.GetInputType()) { case InputType.Button: { return(_curGamepad.IsButtonDown(pb.Input.GetButton())); } case InputType.Key: { return(_curKeyboard.IsKeyDown(pb.Input.GetKey())); } case InputType.MouseButton: { return(_curMouse.IsButtonDown(pb.Input.GetMouseButton())); } } return(false); }
public ClockController(IDeviceFactory deviceFactory) { _display = deviceFactory.GetDisplay(); _button1 = deviceFactory.GetButton(); _button2 = deviceFactory.GetButton(); }