Skip to content

Latest commit

 

History

History
76 lines (54 loc) · 4.08 KB

inkinputprocessingconfiguration_rightdragaction.md

File metadata and controls

76 lines (54 loc) · 4.08 KB
-api-id -api-type -api-device-family-note
P:Windows.UI.Input.Inking.InkInputProcessingConfiguration.RightDragAction
winrt property
xbox

Windows.UI.Input.Inking.InkInputProcessingConfiguration.RightDragAction

-description

Gets or sets how the InkPresenter object handles secondary input from a pen barrel button, pen eraser tip, right mouse button, or similar.

By default, this secondary input is processed as primary input and rendered as an InkStroke (see remarks).

-property-value

The input behavior when modified with a secondary affordance.

-remarks

To pass input as UnprocessedInput through to your app for custom processing, set RightDragAction to LeaveUnprocessed.

-examples

Here, we set RightDragAction to LeaveUnprocessed and declare UnprocessedInput event listeners for pointer input.

inkCanvas.InkPresenter.InputProcessingConfiguration.RightDragAction = 
  InkInputRightDragAction.LeaveUnprocessed;

inkCanvas.InkPresenter.UnprocessedInput.PointerPressed += 
  UnprocessedInput_PointerPressed;
inkCanvas.InkPresenter.UnprocessedInput.PointerMoved += 
  UnprocessedInput_PointerMoved;
inkCanvas.InkPresenter.UnprocessedInput.PointerReleased += 
  UnprocessedInput_PointerReleased;

Here, we define the custom event handlers for pointer input. The handlers are used to implement ink stroke selection.

private void UnprocessedInput_PointerPressed(InkUnprocessedInput sender, Windows.UI.Core.PointerEventArgs args)
{
  lasso = new Polyline()
  {
    Stroke = new SolidColorBrush(Windows.UI.Colors.Blue),
    StrokeThickness = 1,
    StrokeDashArray = new DoubleCollection() {5, 2},
  };

  lasso.Points.Add(args.CurrentPoint.RawPosition);

  selectionCanvas.Children.Add(lasso);
}

private void UnprocessedInput_PointerMoved(InkUnprocessedInput sender, Windows.UI.Core.PointerEventArgs args)
{
  lasso.Points.Add(args.CurrentPoint.RawPosition);
}

private void UnprocessedInput_PointerReleased(InkUnprocessedInput sender, Windows.UI.Core.PointerEventArgs args)
{
  lasso.Points.Add(args.CurrentPoint.RawPosition);

  boundingRect = inkCanvas.InkPresenter.StrokeContainer.SelectWithPolyLine(lasso.Points);

  DrawBoundingRect();
}

-see-also

Pen and stylus interactions, Get started: Support ink in your UWP app, Ink analysis sample (basic) (C#), Ink handwriting recognition sample (C#), Save and load ink strokes from an Ink Serialized Format (ISF) file, Save and load ink strokes from the clipboard, Ink toolbar location and orientation sample (basic), Ink toolbar location and orientation sample (dynamic), Coloring book sample, Family notes sample, Inking sample (JavaScript), Simple inking sample (C#/C++), Complex inking sample (C++), Ink analysis sample