void OnKeyTyped(object source, KeyEventArgs args) { if (args.Consumed) { return; } OnKeyTyped(args.Character); args.Consume(); }
void OnKeyPressed(object sender, KeyEventArgs args) { args.Consume(); var newKey = args.Key != Keys.Escape ? args.Key : Keys.None; if (newKey != Keys.None && (ChangeHandler == null || ChangeHandler(newKey))) { Key = new KeyStroke(newKey, args.Flags); } }
void OnKeyPressed(object sender, KeyEventArgs args) { if (args.Flags.IsShortcutKeyDown() && args.Key == Keys.W) { if (Tabs.ActiveTab != null) { Tabs.ActiveTab.Close(); args.Consume(); } } if (Tabs.Count == 0) { return; } if (args.Flags.IsControlDown() && args.Key == Keys.Tab) { var index = 0; if (Tabs.ActiveTab == null) { index = 0; } else if (args.Flags.IsShiftDown()) { var activeTabIndex = Tabs.IndexOf(Tabs.ActiveTab); if (activeTabIndex <= 0) { activeTabIndex = Tabs.Count - 1; } index = activeTabIndex; } else { index = (index + 1) % Tabs.Count; } Tabs.ActiveTab = (NotebookTab)Tabs[index]; args.Consume(); } }
void OnKeyPressed(object source, KeyEventArgs args) { switch (args.Key) { case Keys.Space: case Keys.Enter: { args.Consume(); OnActivateDown(); break; } } }
void OnKeyReleased(object source, KeyEventArgs args) { switch (args.Key) { case Keys.Space: case Keys.Enter: { args.Consume(); Click(); OnActivateUp(); break; } } }
void OnKeyPressed(object source, KeyEventArgs args) { if (args.Consumed) { return; } switch (args.Key) { case Keys.Space: case Keys.Enter: { args.Consume(); ActivateTab(); break; } default: { break; } } }
void Root_KeyReleased(object sender, KeyEventArgs e) { var p = GameRendering.CenterPoint; switch (e.Key) { case Keys.NumPad4: case Keys.Left: { p += new ContinuousViewportCoordinates(-StepSize, 0); break; } case Keys.NumPad6: case Keys.Right: { p += new ContinuousViewportCoordinates(+StepSize, 0); break; } case Keys.NumPad8: case Keys.Up: { p += new ContinuousViewportCoordinates(0, -StepSize); break; } case Keys.NumPad2: case Keys.Down: { p += new ContinuousViewportCoordinates(0, +StepSize); break; } case Keys.Home: case Keys.NumPad7: { p += new ContinuousViewportCoordinates(-StepSize, -StepSize); break; } case Keys.PageUp: case Keys.NumPad9: { p += new ContinuousViewportCoordinates(+StepSize, -StepSize); break; } case Keys.End: case Keys.NumPad1: { p += new ContinuousViewportCoordinates(-StepSize, +StepSize); break; } case Keys.PageDown: case Keys.NumPad3: { p += new ContinuousViewportCoordinates(+StepSize, +StepSize); break; } } GameRendering.CenterPoint = p; e.Consume(); }
void OnKeyPressed(object source, KeyEventArgs args) { if (ActionMap.Consume(args)) { args.Consume(); return; } var isControlDown = args.Flags.IsControlDown(); var isShiftDown = args.Flags.IsShiftDown(); // ReSharper disable once SwitchStatementMissingSomeCases switch (args.Key) { case Keys.Left: { NavigateTo(Navigate(Direction.Left, isControlDown), isShiftDown); args.Consume(); break; } case Keys.Right: { NavigateTo(Navigate(Direction.Right, isControlDown), isShiftDown); args.Consume(); break; } case Keys.Up: { NavigateTo(Navigate(Direction.Up, isControlDown), isShiftDown); args.Consume(); break; } case Keys.Down: { NavigateTo(Navigate(Direction.Down, isControlDown), isShiftDown); args.Consume(); break; } case Keys.End: { NavigateTo(isControlDown ? Content.Document.TextLength : NavigateToEndOfLine(), isShiftDown); args.Consume(); break; } case Keys.Home: { NavigateTo(isControlDown ? 0 : NavigateToStartOfLine(), isShiftDown); args.Consume(); break; } default: { break; } } }