Skip to content

Latest commit

 

History

History
35 lines (20 loc) · 2.36 KB

pointer.md

File metadata and controls

35 lines (20 loc) · 2.36 KB
-api-id -api-type
T:Windows.UI.Xaml.Input.Pointer
winrt class

Windows.UI.Xaml.Input.Pointer

-description

Provides basic properties for the input pointer associated with a single mouse, pen/stylus, or touch contact.

-remarks

In most cases, we recommend that you get pointer info through the event argument of the pointer event handlers in your chosen language framework (Windows app using JavaScript, UWP app using C++, C#, or Visual Basic, or UWP app using DirectX with C++).

If the event argument doesn't intrinsically expose the pointer details required by your app, you can get access to extended pointer data through the GetCurrentPoint and GetIntermediatePoints methods of PointerRoutedEventArgs. We recommend using these methods as you can specify the context of the pointer data.

The static PointerPoint methods, GetCurrentPoint and GetIntermediatePoints, always use the context of the app. Pointer is an abstract class that is used to describe an input device. This class identifies the input device (such as stylus, finger, or mouse) for each pointer event that occurs.

-examples

The following code example shows the usage of Pointer class to find the unique PointerId of each input contact in an app, use the PointerDeviceType to ignore specific forms of input (for example, mouse input) and store the Pointer positions. For additional code that uses the Pointer class, see the Input sample.

[!code-csharpCode]

-see-also

Input sample