Pointers

Input for universal apps is consolidated into a concept called a pointer. No, this isn’t a C++-style pointer, it’s an abstraction for three separate kinds of input: touch, mouse, and pen. This enables an app to use a single set of APIs for the things that touch, mouse, and pen have in common, which is quite a bit.

The pointer abstraction involves four main classes: PointerDevice, Pointer, PointerPoint, and PointerPointProperties. Figure 5.1 demonstrates their meaning and relationship. A single PC can (and often does) have multiple PointerDevices, each PointerDevice can support multiple Pointers (such as five fingers for touch), and each Pointer can generate a series of PointerPoints.

FIGURE 5.1 The four main pointer classes that consolidate ...

Get Universal Windows® Apps with XAML and C# Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.