Exemplo n.º 1
0
        /// <summary>
        /// Handle <see cref="KeyEventDto"/>s to <see cref="KeyCombination"/>
        /// </summary>
        public KeyCombination Handle(KeyEventDto e, Key removalKey = Key.Back)
        {
            if (e.IsDown(out var down))
            {
                if (e.Key == removalKey)
                {
                    Pop();
                }
                else
                {
                    Add(down);
                }

                return(this);
            }

            if (e.IsUp(out var up))
            {
                TryEnd(up);
                return(this);
            }

            return(this);
        }
Exemplo n.º 2
0
 public static KeyEventDto Down(this Key @this) => KeyEventDto.Down(@this);
Exemplo n.º 3
0
 public static KeyEventDto Up(this Key @this) => KeyEventDto.Up(@this);