示例#1
0
        public override bool Matches(object targetElement, InputEventArgs inputEventArgs)
        {
            bool baseResult = WrappedGesture.Matches(targetElement, inputEventArgs);

            if (baseResult)
            {
                if (inputEventArgs is KeyEventArgs kargs)
                {
                    // only delay repetitions (i.e. when the user keeps the key pressed)
                    if (kargs.IsRepeat)
                    {
                        // check if the time elapsed already
                        if (Environment.TickCount - lastExecutionTick >= RepeatDelay)
                        {
                            lastExecutionTick = Environment.TickCount;
                            return(true);
                        }
                        else
                        {
                            return(false);
                        }
                    }
                    else
                    {
                        lastExecutionTick = Environment.TickCount;
                    }
                }
            }

            return(baseResult);
        }
示例#2
0
 public bool KeysMatch(object targetElement, InputEventArgs inputEventArgs)
 {
     return(WrappedGesture.Matches(targetElement, inputEventArgs));
 }