private void OnKeyDown(object sender, VirtualKeyCodeEventArgs e) { _control.OnKeyDown(e); if (e.Handled) { return; } if (Keyboard.Modifiers == ModifierKeys.Control) { if (e.Key == Keys.W || e.Key == Keys.F4) { e.Handled = true; Close(); } } else { if (e.Key == Keys.Escape) { e.Handled = true; Close(); } } }
private void OnPreviewKeyUp(object sender, VirtualKeyCodeEventArgs e) { if (e.Key != Keys.RMenu) { return; } e.Handled = true; e.SkipMainEvent = true; User32.SendInput(new User32.KeyboardInput { ScanCode = Inputter.ToScanCode(Keys.LMenu), Flags = User32.KeyboardFlag.ScanCode | User32.KeyboardFlag.KeyUp }); }
public void OnKeyDown(VirtualKeyCodeEventArgs e) { if (e.Key >= Keys.D1 && e.Key <= Keys.D9) { PasteClipboardEntry(Model.Recent.OfType <ClipboardEntry>().ElementAtOrDefault(e.Key - Keys.D1)); } else if (e.Key >= Keys.F1 && e.Key <= Keys.F24) { PasteClipboardEntry(Model.Pinned.OfType <ClipboardEntry>().ElementAtOrDefault(e.Key - Keys.F1)); } else { return; } e.Handled = true; KeyboardListener.IgnoreNextReleased(e.Key); }
public void OnKeyDown(VirtualKeyCodeEventArgs e) { if (e.Key == Keys.Tab) { var selected = Tabs.SelectedSource; Tabs.SelectedSource = ( User32.IsKeyPressed(Keys.LShiftKey) || User32.IsKeyPressed(Keys.RShiftKey) ? Tabs.Links.Concat(Tabs.Links.TakeWhile(x => x.Source != selected)).LastOrDefault() : Tabs.Links.SkipWhile(x => x.Source != selected).Skip(1).Concat(Tabs.Links).FirstOrDefault() )?.Source ?? selected; e.Handled = true; } else if (e.Key >= Keys.D1 && e.Key <= Keys.D9 && User32.IsKeyPressed(Keys.LControlKey) || User32.IsKeyPressed(Keys.RControlKey)) { Tabs.SelectedSource = Tabs.Links.ElementAtOrDefault(e.Key - Keys.D1)?.Source ?? Tabs.SelectedSource; e.Handled = true; } }
private void OnKeyUp(object sender, VirtualKeyCodeEventArgs e) { _control.OnKeyUp(e); }
public void OnKeyUp(VirtualKeyCodeEventArgs e) { }