Add a Touch Event to a project screen
- Last UpdatedOct 29, 2026
- 2 minute read
Add a Touch Event to a project screen in order to process touch input on the screen in general, rather than on a specific object in the screen.
This task is a supplement to other topics that discuss how to use multi-touch gestures in your project. You must have the Multi-Touch feature enabled, either for your entire project or for a specific project screen, and you must have either Inner or Outer mode selected. For more information, see About the Multi-Touch settings for project screens.
Also, this task assumes you already have the Screen worksheet open for editing, and it begins from that point.
Touch Events are added to a project screen through the Screen Script worksheet.
To add a Touch Event to a project screen:
-
Do one of the following:
-
On the Draw tab of the ribbon, in the Screen group, click Script; or
-
Right-click anywhere in the screen worksheet, and then click Screen Script on the shortcut menu.
The screen's associated Screen Script worksheet is opened for editing.
-
-
Right-click anywhere in the worksheet, and then point to Add Touch Event on the shortcut menu.
A sub-menu of the available Touch Events is displayed.
-
On the sub-menu, click the Touch Event that you want to add.
Option
Description
Process the raw data from the touch input. The sub-routine is continuously executed while the user touches the project screen.
Perform an action once, when the user starts touching the project screen.
Perform an action each time the user moves their fingers on the project screen.
Perform an action once, when the user stops touching the project screen.
Sub Screen_OnSwipeRight
Perform an action once, when the user swipes horizontally from left to right on the project screen.
Sub Screen_OnSwipeLeft
Perform an action once, when the user swipes horizontally from right to left on the project screen.
Sub Screen_OnSwipeDown
Perform an action once, when the user swipes vertically from top to bottom on the project screen.
Sub Screen_OnSwipeUp
Perform an action once, when the user swipes vertically from bottom to top on the project screen.
Tip: Swipe means to quickly move your finger across the screen in a specific direction (up, down, left, right).
The Touch Event is inserted as a VBScript sub-routine in the worksheet.
-
Click in the sub-routine that you just inserted, and then type your VBScript code.
At this point, you can develop the Touch Event just as you would develop any other VBScript sub-routine in your project. For more information, see Overview of VBScript.
The OnTouch sub-routines each have predefined parameters that are described in subsequent topics in this section. Do not edit those parameters; they receive data from the touch input and then make it available for use in your code.
The OnSwipe sub-routines do not have any parameters. They are executed as-is when the corresponding events occur.