As you may know you can use Xojo for applications running on Windows tables with x86 CPU. You may design your user interface with big buttons and the user can use the application with touch instead of a mouse pointer. Windows may even show a keyboard on screen to enter text for your text fields. Windows provides mouse events for you automatically.

Now you may need more and our WinPointerEventsMBS, WinGestureConfigMBS, WinGestureInfoMBS and WinPointerInfoMBS classes can help you. We actually have two interfaces there united. First, we have gesture events for Windows 7 and newer. You can get gestures like rotate, two finder tap, zoom and pan. Second, we have for Windows 8/8.1 or newer the pointer API wrapped, so you can get events from a pointer device. The device can be a mouse, a pen or a finger.

To use those events, you subclass WinPointerEventsMBS class and add events as needed. This includes events for receiving pointer and gesture events. You instantiate your subclass and pass to constructor the reference to the one window you like to receive events from. The plugin will attach to the window and redirect events to the class. Please use one instance of your subclass per window.

Next you can use WinGestureConfigMBS class objects to register for gestures and specify which gestures you support. Our sample application registers for all gestures to show you what is detected. But if you need only one or two gesture types, you may increase detection rate for your gesture types if you clearly state you are not expecting some others.

So you may see pointer events coming in. First, we have events like PointerInRange and PointerOutOfRange to let you know when a pen is coming or leaving screen. PointerDeviceChange informs you about changes to the configuration, e.g. about orientation changes. When device enters your window, you get PointerEnter events and PointerLeave event, when it leaves. While the pointer is over your window, you may receive down and up events as well as update for movement. Each event brings WinPointerInfoMBS object to describe the event with details.

So while mouse events in Xojo are good for most applications, you can make the extra effort to support pointer devices for Windows and get more details on touch events.

If needed we could add more, e.g. to query pressure for touch events or tilt for a pen.
20 10 17 - 19:07