/// <summary> /// Raises the <see cref="KeyDown" /> event. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="OxyMouseEventArgs" /> instance containing the event data.</param> protected virtual void OnKeyDown(object sender, OxyKeyEventArgs e) { var handler = this.KeyDown; if (handler != null) { handler(sender, e); } }
/// <summary> /// Raises the <see cref="KeyDown" /> event. /// </summary> /// <param name="e">The <see cref="OxyKeyEventArgs" /> instance containing the event data.</param> protected internal virtual void OnKeyDown(OxyKeyEventArgs e) { var handler = this.KeyDown; if (handler != null) { handler(this, e); } }
protected override bool OnKey(SciterElement se, SciterXBehaviors.KEY_PARAMS prms) { if (prms.cmd == (uint)SciterXBehaviors.KEY_EVENTS.KEY_DOWN) { Keys key = (Keys)prms.key_code; var args = new OxyKeyEventArgs { ModifierKeys = prms.alt_state.GetModifiers(), Key = key.Convert() }; return(ActualController.HandleKeyDown(this, args)); } return(false); }
public virtual void HandleKeyDown(object sender, OxyKeyEventArgs e) { foreach (var element in this.GetHitTestElements()) { element.OnKeyDown(e); if (e.Handled) { break; } } if (!e.Handled) { this.OnKeyDown(sender, e); } }
/// <summary> /// Handles key down events. /// </summary> /// <param name="view">The plot view.</param> /// <param name="args">The <see cref="OxyKeyEventArgs" /> instance containing the event data.</param> /// <returns><c>true</c> if the event was handled.</returns> public virtual bool HandleKeyDown(IView view, OxyKeyEventArgs args) { lock (this.GetSyncRoot(view)) { if (view.ActualModel == null) { return(false); } view.ActualModel.HandleKeyDown(this, args); if (args.Handled) { return(true); } var command = this.GetCommand(new OxyKeyGesture(args.Key, args.ModifierKeys)); return(this.HandleCommand(command, view, args)); } }
/// <summary> /// Handles key down events. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="OxyKeyEventArgs" /> instance containing the event data.</param> public virtual void HandleKeyDown(object sender, OxyKeyEventArgs e) { // Revert the order to handle the top-level elements first foreach (var element in this.GetElements().Reverse()) { var uiElement = element as UIElement; if (uiElement == null) { continue; } uiElement.OnKeyDown(e); if (e.Handled) { break; } } if (!e.Handled) { this.OnKeyDown(sender, e); } }
/// <summary> /// Handles key down events. /// </summary> /// <param name="view">The plot view.</param> /// <param name="args">The <see cref="OxyKeyEventArgs" /> instance containing the event data.</param> /// <returns><c>true</c> if the event was handled.</returns> public virtual bool HandleKeyDown(IView view, OxyKeyEventArgs args) { lock (this.GetSyncRoot(view)) { if (view.ActualModel == null) { return false; } view.ActualModel.HandleKeyDown(this, args); if (args.Handled) { return true; } var command = this.GetCommand(new OxyKeyGesture(args.Key, args.ModifierKeys)); return this.HandleCommand(command, view, args); } }
private void onKeyDownCuttingInsidePolygon(OxyKeyEventArgs e) { bool cuttingInsidePolygon = CurMainStage == Stage.Cutting; //&& CurSubStage == SubStage.Half; if (!cuttingInsidePolygon) return; //if (e.Key == OxyKey.L || e.Key == OxyKey.R && e.IsControlDown) //{ // Selection2DeleteBoundary(e.Key); // return; //} if (e.Key == OxyKey.P && e.IsControlDown) { CompletePolygon();// return; } if (e.Key == OxyKey.Delete) { DeleteInsidePolygon(); return; } ExtendCuttingLine(e.Key); }
private void onKeyDown(OxyKeyEventArgs e) { //onKeyDownCuttingByPolygon(e); onKeyDownCuttingInsidePolygon(e); }
void plotModel_KeyDown(object sender, OxyKeyEventArgs e) { onKeyDown(e); }
/// <summary> /// Raises the <see cref="E:System.Windows.Forms.Control.PreviewKeyDown" /> event. /// </summary> /// <param name="e">A <see cref="T:System.Windows.Forms.PreviewKeyDownEventArgs" /> that contains the event data.</param> protected override void OnPreviewKeyDown(PreviewKeyDownEventArgs e) { base.OnPreviewKeyDown(e); var args = new OxyKeyEventArgs {ModifierKeys = GetModifiers(), Key = e.KeyCode.Convert()}; this.ActualController.HandleKeyDown(this, args); }
/// <summary> /// Handles key down events. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="OxyKeyEventArgs" /> instance containing the event data.</param> public virtual void HandleKeyDown(object sender, OxyKeyEventArgs e) { foreach (var element in this.GetHitTestElements()) { element.OnKeyDown(e); if (e.Handled) { break; } } if (!e.Handled) { this.OnKeyDown(sender, e); } }