Using Touchscreen Mode
It is very common to deploy Ignition Vision projects on touchscreen computers. Often, these are industrial panel-pcs acting as Human Machine Interface (HMI) or Operator Interface Terminal (OIT). The touchscreens simply act like a mouse input device and usually don't have a keyboard attached. For this reason, all of the input components in Vision are touchscreen-enabled.
Under normal circumstances, you don't have to do anything special other than enable touchscreenmode on your project. This will allow the operator to enable touchscreen mode when they log in. You can also enable touchscreen mode via scripting.
Touchscreen-enabled input components all have an expert level property called Touchscreen Mode. Normally, this is set to Single-Click, meaning that the touchscreen keyboard or numeric keypad (depending on the type of input component) will appear on a single click in that component. You can also change this to Double-Click, which should be self-explanatory, or None. None means that automatic touchscreen support is disabled for this component. You may want to set this to handle touchscreen logic via scripting.
To handle touchscreen logic via scripting, the general pattern is to respond to a mouse event, popup up a keyboard, and then set the component's value to whatever was entered in the keyboard. For
example, for a text field, you would write a script like this:
if
system.gui.isTouchscreenModeEnabled():
currentText
=
event.source.text
newText
=
system.gui.showTouchscreenKeyboard(currentText)
See also: Client/General Properties , system.gui.setTouchscreenModeEnabled
Touchscreen support is built into Ignition. Turn it on through the Project Properties or scripting.
To turn on the touchscreen mode
-
In the Desinger, from Project Browser, double-click on Project > Properties, or from the top menus go to Project > Properties.
The Project Properties window is displayed. -
Go to Client > General page, to see the Touch Screen options.
Touch Screen Mode Enabled
By default, this is enabled, which means an operator can activate the mode on the startup screen. All Clients can operate in touch-screen mode. When Touch Screen mode is enabled, clicking on numeric and text entry boxes will pop up on-screen keyboards that can be used for data entry.
Touch Acreen Mode Active on Startup
This option sets the Clients to start up with the touch-screen mode active.
These settings are helpful for mixed-use projects, that is, those that are launched on both touch-screen devices and traditional computers and laptops.