public AuxiliaryButtonHandler(int buttonIndex) { button = TabletAuxiliaryButton.Button1 + buttonIndex; Size = new Vector2(50); InternalChildren = new[] { background = new Container { RelativeSizeAxes = Axes.Both, Colour = Color4.DarkGreen, Alpha = 0, Child = new Box { RelativeSizeAxes = Axes.Both } }, new SpriteText { Anchor = Anchor.Centre, Origin = Anchor.Centre, Text = $"B{buttonIndex + 1}" } }; }
/// <summary> /// Get the <see cref="TabletAuxiliaryButtonEventManager"/> responsible for a specified tablet auxiliary button. /// </summary> /// <param name="button">The button to find the manager for.</param> /// <returns>The <see cref="TabletAuxiliaryButtonEventManager"/>.</returns> public TabletAuxiliaryButtonEventManager GetButtonEventManagerFor(TabletAuxiliaryButton button) { if (tabletAuxiliaryButtonEventManagers.TryGetValue(button, out var existing)) { return(existing); } var manager = CreateButtonEventManagerFor(button); manager.GetInputQueue = () => NonPositionalInputQueue; return(tabletAuxiliaryButtonEventManagers[button] = manager); }
public static InputKey FromTabletAuxiliaryButton(TabletAuxiliaryButton auxiliaryButton) => (InputKey)((int)InputKey.FirstTabletAuxiliaryButton + auxiliaryButton);
/// <summary> /// Create a <see cref="TabletAuxiliaryButtonEventManager"/> for a specified tablet auxiliary button. /// </summary> /// <param name="button">The button to be handled by the returned manager.</param> /// <returns>The <see cref="TabletAuxiliaryButtonEventManager"/>.</returns> protected virtual TabletAuxiliaryButtonEventManager CreateButtonEventManagerFor(TabletAuxiliaryButton button) => new TabletAuxiliaryButtonEventManager(button);
public void SetButtonPressed(TabletAuxiliaryButton button, bool pressed) => AuxiliaryButtons.SetPressed(button, pressed);
public bool IsButtonPressed(TabletAuxiliaryButton button) => AuxiliaryButtons.IsPressed(button);
protected TabletAuxiliaryButtonEvent(InputState state, TabletAuxiliaryButton button) : base(state) { Button = button; }
public TabletAuxiliaryButtonPressEvent(InputState state, TabletAuxiliaryButton button) : base(state, button) { }