InkInputProcessingConfiguration
InkInputProcessingConfiguration
InkInputProcessingConfiguration
InkInputProcessingConfiguration
Class
Definition
Provides properties for managing the input behavior (standard or modified) of the InkPresenter object.
Standard ink input is not modified with a secondary affordance, such as a pen barrel button, right mouse button, or similar.
By default, modified input is processed as standard input and rendered as an InkStroke. You must set RightDragAction to LeaveUnprocessed to pass the input through as UnprocessedInput for custom processing by your app.
public : sealed class InkInputProcessingConfiguration : IInkInputProcessingConfigurationpublic sealed class InkInputProcessingConfiguration : IInkInputProcessingConfigurationPublic NotInheritable Class InkInputProcessingConfiguration Implements IInkInputProcessingConfiguration// This API is not available in Javascript.
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Remarks
If InkInputProcessingConfiguration.Mode is set to None, the value of RightDragAction is ignored and input is always passed as UnprocessedInput through to your app for custom processing.
If InkInputProcessingConfiguration.Mode is set to Inking or Erasing, the value of RightDragAction must be set to LeaveUnprocessed to pass input as UnprocessedInput through to your app for custom processing.
Properties
Mode Mode Mode Mode
Gets or sets how the InkPresenter object handles input (standard and modified) on its associated InkCanvas control.
Note
Standard input is not modified with a secondary affordance, such as a pen barrel button, right mouse button, or similar.
Input can be handled as standard ink or erase strokes, or it can be passed as UnprocessedInput through to your app for custom processing.
public : InkInputProcessingMode Mode { get; set; }public InkInputProcessingMode Mode { get; set; }Public ReadWrite Property Mode As InkInputProcessingMode// This API is not available in Javascript.
The input behavior.
- See Also
RightDragAction RightDragAction RightDragAction RightDragAction
Gets or sets the input behavior of the InkPresenter object, when the input is modified with a secondary affordance, such as a pen barrel button, right mouse button, or similar.
By default, modified input is processed as standard input and rendered as an InkStroke (see remarks).
public : InkInputRightDragAction RightDragAction { get; set; }public InkInputRightDragAction RightDragAction { get; set; }Public ReadWrite Property RightDragAction As InkInputRightDragAction// This API is not available in Javascript.
- Value
- InkInputRightDragAction InkInputRightDragAction InkInputRightDragAction InkInputRightDragAction
The input behavior when modified with a secondary affordance.
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();
}
Remarks
To pass input as UnprocessedInput through to your app for custom processing, set RightDragAction to LeaveUnprocessed.
- See Also