Beispiel #1
0
        // Invoked from MessageWindow to propagate event to consumer's handler
        private static void OnHotKeyPressed(HotkeyEventArgs e)
        {
            //Logger.Current.WriteLine($"keypress key:{e.Key} mods:{e.Modifiers}");

            var key = registeredKeys
                      .FirstOrDefault(k =>
                                      k.Key == (uint)e.Key &&
                                      k.Modifiers == (uint)(e.Modifiers | Hotmods.NoRepeat));

            if (key != null)
            {
                if (key.Action != null)
                {
                    key.Action();
                }
                else
                {
                    HotKeyPressed?.Invoke(null, e);
                }
            }
        }
Beispiel #2
0
 // Invoked from MessageWindow to propagate event to consumer's handler
 private static void OnHotKeyPressed(HotkeyEventArgs e)
 {
     HotKeyPressed?.Invoke(null, e);
 }