Example: Multitouch Handling
Product: CODESYS Visualization
This example shows how to evaluate touch events on multitouch displays and how to handle them.
When a visualization can be executed on a multi-touch display, an additional operating concept is available to you. Then, gestures and touch events can also be evaluated and processed in addition to the usual mouse and keyboard events.
Supported gestures:
Panning:
By using a finger to press, drag, and release, the contents of a window or a tab is moved.
Flicking:
By quickly moving a finger, different visualization images are toggled in the selected area.
Multitouch event:
For operation with several fingers simultaneously
This has the effect that in a visualization a user can operate multiple elements simultaneously with several fingers.
As a result, an application engineer can implement a two-hand control or a virtual mixer where multiple sliders can be operated simultaneously.
Description
The IGestureEventHandler
interface from the VisuElems.VisuElemBase
library allows for the implementation of IEC 61131-3 code in order to respond to gestures. A gesture event can be captured and follow-up actions can be implemented.
The following clients can execute the visualization on a multitouch device.
CODESYS TargetVisu on a device with a Windows operating system
CODESYS TargetVisu on a device with a Linux operating system
Additional information
The MultiTouchExample.project
project shows how to use of the IGestureEventHandler2
interface.
The GesturesHandler
function block implements the IGestureEventHandler2
interface. First, the event handler has to be registered with the event manager. This is done in the FB_Init
method of the GestenHandler
function block.
The HandleFlickGesture
, HandlePanGesture
, and HandleTouchEvent
methods are called when a corresponding event occurs.
Scrolling:
Within a frame or the tabs element, an operator can scroll to the next visualization.
Multiple entries:
Input elements can be operated simultaneously.
Two-hand operation:
The example demonstrates the input handling with two hands.
Touch events in IEC 61131-3:
The example shows the current touch points on the screen.
Flick detection:
The horizontal and vertical flick events are counted.
System requirements and restrictions
Programming system | CODESYS Development System (version 3.5.14.0 or higher) |
Runtime system | CODESYS Control Win (version 3.5.14.0) |
Add-on components | - |
Note
DOWNLOAD Project