예제 #1
0
 private void OnKeyInputReceived(ConsoleKeyInfo info)
 {
     if (info.Key == ConsoleKey.Enter || info.Key == ConsoleKey.Spacebar)
     {
         Pressed.Fire();
     }
 }
예제 #2
0
 private void RegisterShortcutIfPossibleAndNotAlreadyDone()
 {
     if (Shortcut != null && shortcutRegistered == false && Application != null)
     {
         shortcutRegistered = true;
         Application.FocusManager.GlobalKeyHandlers.PushForLifetime(Shortcut.Key, Shortcut.Modifier, () =>
         {
             if (this.CanFocus)
             {
                 Pressed.Fire();
             }
         }, this);
     }
 }
예제 #3
0
 private void Click()
 {
     Pressed.Fire();
 }