public MainWindow() { InitializeComponent(); SettingWindow = new SettingWindow(this) { Visibility = Visibility.Hidden }; Hotkey = new LauncherHotkey(this); RegisterHotkey(); Keyword.Focus(); ReservedKey = new ReservedKey(this); }
private void Keyword_KeyDown(object sender, KeyEventArgs e) { var key = Keyword.Text.Trim(); switch (e.Key) { case Key.F1: ShowSetting(key: key); break; case Key.Enter: if (ReservedKey.IsMatch(key)) { ReservedKey.Do(key); return; } Decide(); break; } }