private void OnKeyInputReceived(ConsoleKeyInfo info) { if (info.Key == ConsoleKey.Enter || info.Key == ConsoleKey.Spacebar) { Pressed.Fire(); } }
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); } }
private void Click() { Pressed.Fire(); }