Top  | Previous | Next

Touchscreen Support

It is very common to deploy Ignition Vision projects on touchscreen computers. Often, these are industrial panel-pcs acting as HMI or OIT terminals. Normally touchscreens simply act like a mouse input device. However, these touchscreens 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 touchscreen-mode 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