DeviceType (StylusInfo)


Gets a value that indicates whether the stylus represents mouse, stylus, or touch input.

value = object.DeviceType
object.DeviceType = value

Type: DeviceType Enumeration

The type of the input device, as a value of the enumeration.

This property is read-only. There is no default.

You obtain StylusInfo by calling a method of the MouseEventArgs object that you get from input parameters for the mouse event handler. The stylus input model is tied to mouse events, so that the mouse can be used as a default input mode.

The following example demonstrates how to display the type of device that was used to create the current StylusPoint.

// Capture mouse movement when the left button is pressed and create the stroke.
function InkPresenterMouseDown(sender,args)
  // Display the type of input device in a TextBlock.
  device.Text = args.GetStylusInfo().deviceType;
  newStroke = agCtrl.content.createFromXaml('<Stroke/>');

Community Additions