Troubleshooting
Fixing a Missing On-Screen Keyboard From Scripted Input Dialogs
Short answer
The scripted input dialog and the touchscreen keyboard are both modal, and one modal dialog cannot open over another, so the field inside the prompt never raises the keyboard. Replace the call with a popup window of palette inputs, or wrap it in a function that branches on touch mode and calls system.gui.showTouchscreenKeyboard or system.gui.showNumericKeypad.
On this page
Tapping the text field inside a scripted system.gui.inputBox prompt raises no on-screen keyboard because it cannot: in Ignition, the scripted dialog and the touchscreen keyboard are both modal dialogs, and the client will not open one modal dialog while another is up. While the box is open it also halts event handling on the client's main GUI thread, so no project setting changes the behavior. Touch Screen Mode Enabled is working — palette input components on the same screen prove it. The repair is to stop asking the dialog to host a keyboard: replace the prompt with a popup window of palette input components, or wrap the call in a function that branches on touch mode and collects the entry with system.gui.showTouchscreenKeyboard or system.gui.showNumericKeypad.
Confirm touch mode is actually active #
Rule this out first, because every other step assumes it. Setting Touch Screen Mode Enabled in project properties marks the project as a touch project; the client session must also run in touch mode for the automatic keyboard and keypad to appear. Touch mode can be turned on through Project Properties or scripting.
- Tap a palette text field or numeric field on any window of the same client session. With touch mode active, the client shows the keyboard or keypad on those inputs automatically. If it appears, you have the fault this article covers.
- If no palette input raises the keyboard either, the client is not in touch mode. Fix the launch mode first; the dialog behavior has not been tested yet.
- For a script-level confirmation, evaluate
system.gui.isTouchscreenModeEnabled()from a button script and write the result to a label. True means the client reports touch mode.
Why the dialog cannot host the touch keyboard #
The signature of the fault: palette inputs raise the keyboard, the field inside system.gui.inputBox does not, and nothing is logged. The two input paths are different code. Palette components live inside your window, and a touch-mode client attaches its keyboard to them. The box functions are script calls that open a separate Java dialog, and the field inside that dialog never requests the touch keyboard.
The mechanism is structural. The dialog functions are modal: while one is open, it halts event handling on the client's main GUI thread and blocks the calling script until the user closes it. The touchscreen keyboard is also a modal dialog, and one modal dialog cannot be open while another is up — the deliberate background-input blocking that configuring modal dialogs to block background input covers on another platform is the same mechanism working against you here. Two consequences follow:
- There is no argument on
system.gui.inputBoxto request a keyboard or a keypad. The option does not exist, so no call variant fixes this. - The whole client stops updating for as long as the box is open — the same main-thread halt behind why an HMI screen freezes until a script finishes, and a second reason to keep the box functions off screens that must refresh alarms and values.
What the logs will and will not show #
Nothing. The prompt has no tag, no binding, and no component property behind it; the text field exists only inside the dialog the script opens. The dialog opens, accepts a physical keyboard, and simply never requests the touch keyboard, so the console and the gateway logs stay silent. Do not spend time on tag quality, binding indirection, or driver connectivity for this symptom. If quality codes or binding errors appear elsewhere on the screen, treat them as a separate fault.
Three working replacements #
| Replacement | Where it lives | What you get | Use it when |
|---|---|---|---|
| Popup window with palette inputs | A window in the project | Palette inputs raise the keyboard, the client keeps updating, and the entry gets a label and layout | Permanent screens; it costs one window per prompt type |
| Touch-mode wrapper function | Project script library | inputBox and passwordBox on desktops, keyboard and keypad calls on touch clients |
The fastest retrofit when many scripts already call the box functions |
| Direct keyboard or keypad call | The call site | The keyboard opens with no accompanying text field | One-off entries where the operator already knows what to type |
The popup is the sound design: no modal conflict, no main-thread halt, and room for instructions on screen. The wrapper keeps a script-only workflow alive at the panel, at the cost of announcing each field with a message box, because the keyboard dialog carries no prompt text of its own. When the entry grows into a designed screen, the palette-first approach behind building a complete on-screen keyboard from bitmap HMI assets is the natural next step.
Worked example: wrapping a username and password prompt on a touch HMI #
The inputs #
- Touch mode is active at the panel, confirmed by the palette-input tap in the first section.
- The prompt must return two strings, a username and a password, that feed
system.security.validateUserand thensystem.security.getUserRolesbefore an action runs and an audit entry is written. - The password entry must be masked: the last argument of the keyboard call is True for that field and False for the username.
- The example accepts 20 characters per entry. Confirm what that argument controls in the vendor's scripting reference for your version before you reuse the call.
- Desktop clients keep the original
system.gui.inputBoxandsystem.gui.passwordBoxprompts.
The rule in words #
If system.gui.isTouchscreenModeEnabled() returns True, announce each field with system.gui.messageBox, then collect it with system.gui.showTouchscreenKeyboard. The message box closes on OK before the keyboard opens, so the two modal dialogs never overlap. Otherwise fall through to the original box calls.
The wrapper function #
def getUserAndPassword():
if system.gui.isTouchscreenModeEnabled():
# Touch client: the keyboard dialog carries no prompt text, so announce each field first.
system.gui.messageBox('Press OK, then enter your username.')
user = system.gui.showTouchscreenKeyboard('', 20, False)
system.gui.messageBox('Press OK, then enter your password.')
password = system.gui.showTouchscreenKeyboard('', 20, True)
else:
# Desktop client: the original modal prompts.
user = system.gui.inputBox('Enter your Username')
password = system.gui.passwordBox('Enter your password.')
return user, password
user, password = getUserAndPassword()
user and password are example variables: each holds the string one prompt returns, or the cancel result when the operator dismisses it. The system.gui and system.security names are the documented API. On the audit side, log the validated username only, never the password string.
The test that proves it #
- Launch the client in touch mode on the actual touch HMI, not only on a workstation with a physical keyboard.
- Trigger the calling script: the announcement appears, OK closes it, the keyboard opens, and the typed username lands in
user; the second pass masks the password. - Feed a valid pair to
system.security.validateUserand confirm roles come back; feed an invalid pair and confirm they do not. Cancel each prompt once and record what the call returns, so the cancel branch is written against a measured value rather than an assumption. - Repeat on a desktop client and confirm the original box prompts appear.
The decision #
Keep the wrapper for this prompt: it is wired into existing scripts, works on both client types, and masks the password field. The next time the screen is redesigned, move the entry into a popup window, which labels the field directly, never halts the client, and needs no announcing message box. For a single one-off entry, call system.gui.showTouchscreenKeyboard or system.gui.showNumericKeypad at the call site and skip the wrapper entirely.
Questions asked
Is there an argument on system.gui.inputBox that turns the touch keyboard on?
No. The call has no keyboard or keypad option, and none is needed for the fault to appear: the dialog and the keyboard are both modal, so the keyboard can never open while the prompt is up. If you want the option tracked, raise it with the vendor's support channel as an enhancement request; until then, use the wrapper or a popup window.
Why does the touch keyboard always open at the bottom of the screen?
The touchscreen alpha keyboard and the numeric keypad dialogs are hardcoded to open at the bottom of the screen as fixed modal dialogs. No script argument repositions them, so plan the announcing message and the window layout around a keyboard that occupies the lower part of the display.
Can I keep system.gui.inputBox on desktop clients?
Yes. A desktop client with a physical keyboard types into the dialog normally, which is why the fault only shows at the panel. The wrapper keeps the original inputBox and passwordBox calls on the desktop branch. The main-thread halt still applies there, so keep the dialogs off screens that must keep refreshing alarms and values.
Will a popup window replacement also freeze the client?
No. A popup window is a normal window in the project, not a modal dialog blocking the event dispatch thread. Palette input components inside it raise the touch keyboard on their own, the rest of the client keeps updating, and you can label the entry field directly instead of announcing it with a message box.
Does the wrapper work with the numeric keypad too?
Yes. Call system.gui.showNumericKeypad in the touch branch wherever the entry is a number, and keep the same isTouchscreenModeEnabled check. The keypad is the same kind of modal dialog as the keyboard, so the sequencing rule is identical: close the message box first, then open the keypad.