Ejemplo n.º 1
0
            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}"
                    }
                };
            }
Ejemplo n.º 2
0
        /// <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);
        }
Ejemplo n.º 3
0
 public static InputKey FromTabletAuxiliaryButton(TabletAuxiliaryButton auxiliaryButton) => (InputKey)((int)InputKey.FirstTabletAuxiliaryButton + auxiliaryButton);
Ejemplo n.º 4
0
 /// <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);
Ejemplo n.º 5
0
 public void SetButtonPressed(TabletAuxiliaryButton button, bool pressed) => AuxiliaryButtons.SetPressed(button, pressed);
Ejemplo n.º 6
0
 public bool IsButtonPressed(TabletAuxiliaryButton button) => AuxiliaryButtons.IsPressed(button);
Ejemplo n.º 7
0
 protected TabletAuxiliaryButtonEvent(InputState state, TabletAuxiliaryButton button)
     : base(state)
 {
     Button = button;
 }
 public TabletAuxiliaryButtonPressEvent(InputState state, TabletAuxiliaryButton button)
     : base(state, button)
 {
 }