zenon 7.10 and Windows 8 Multi-Touch – Programming in VSTA – Part 1

In the previous blog entries regarding Multi-Touch we talked about the natively integrated features in zenon 7.10. However, the creativity of our customers has no limit and zenon, being an open system, supports the integration of custom solutions e.g. via VSTA.

Fundamentals

The new features Windows 8 brings to Multi-Touch can be used directly via the zenon API (VSTA only, because of 64-bit). If you take a closer look at what’s happening in the background when moving your finger around the screen for example, you will find that a lot of single events are being generated. On the one hand this means that you get a lot of data you need to sort through by yourself and on the other hand a great deal of performance is wasted. When talking about Multi-Touch events we need to distinguish between two types:

  • Raw touch points (WM_POINTER messages)
  • Preprocessed, recognized gestures, e.g. a manipulation

Raw touch points in VSTA

This time we are focusing on the raw touch points: zenon 7.10 now allows you to pre-filter these messages at each screen, so if you are only interested in receiving PointerDown and PointerUp messages you don’t have to handle everything else and analyze thousands of events to find the right one. In VSTA you can react on events like

  • PointerActivate
  • PointerCaptureChanged
  • PointerDeviceChange
  • PointerDeviceInRange
  • PointerDeviceOutOfRange
  • PointerDown
  • PointerEnter
  • PointerHWheel
  • PointerLeave
  • PointerUp
  • PointerUpdate
  • PointerWheel

For example:

void DynPics_PointerDown(zenOn.IDynPicture obDynPicture, zenOn.IElement obElement, object vPointerId, bool bNew, bool bInRange, bool bInContact, bool bPrimary, bool bFirstButton, bool bSecondButton, bool bThirdButton, bool bFourthButton, bool bFifthButton, int lX, int lY)
{
string CelString = string.Format(“VSTA: {0} on {1} “,
System.Reflection.MethodBase.GetCurrentMethod().Name, obDynPicture.Name);
string ButtonMatrix = “”;
ButtonMatrix += (bFirstButton == true) ? “[1]” : “[x]”;
ButtonMatrix += (bSecondButton == true) ? “[2]” : “[x]”;
ButtonMatrix += (bThirdButton == true) ? “[3]” : “[x]”;
ButtonMatrix += (bFourthButton == true) ? “[4]” : “[x]”;
ButtonMatrix += (bFifthButton == true) ? “[5]” : “[x]”;
 
CelString += string.Format(“pointer-id: {0}, is-new: {1}, is-in-range: {2}, is-in-contact: {3}, is-primary: {4}, buttons: {5}, [X, Y]: {6},{7}”, Convert.ToString(vPointerId), bNew, bInRange, bInContact, bPrimary, ButtonMatrix, lX, lY);
Cel().WriteCelString(CelString);
}

For further information on this Pointer, please call up GetPointerInfo(VARIANT vPointerId) As VARIANT

 

 

Tags: , , ,

Leave a Reply