Add a Touch Event to a screen object
Add a Touch Event to a screen object in order to process touch input on that object.
Before you begin this task, you should already have the screen worksheet open for editing. You should also have created the screen object to which you want to add the Touch Event.
Touch Events are added to a screen object through the Command animation.
To add a Touch Event to a screen object:
- Click the screen object to which you want to add the Touch Event. The screen object is selected.
- On the Graphics tab of the ribbon, in the Animations group, click Command. The Command animation is added to the selected screen object.
- Double-click the screen object. The Object Properties dialog is displayed.
- If the Command animation properties are not already displayed, then in the properties list (in the top-right corner of the dialog), click Command.
- If the VBScript event tabs are not already displayed, then in the Type list, click VBScript.
Figure 1. VBScript event tabs in the Command animation properties
- In the VBScript event tabs, click the tab for the Touch Event that you want to add. You may need to use the arrow buttons to scroll through the tabs.
Tab Description On Touch Process the raw data from the touch input. The sub-routine is continuously executed while the user touches the screen object. On Touch Start Perform an action once, when the user starts touching the screen object. On Touch Delta Perform an action each time the user manipulates on the screen object. On Touch Completed Perform an action once, when the user stops touching the screen object.
- Click in the text box below, 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.