Pop Up keyboard in for system.gui.password input

New to Ignition, have a password box popup with

tagValue = True
password = system.gui.passwordBox(“Please enter the password.”)
if password == “1234”:
system.nav.openWindow(“Release”)
else:
system.gui.errorBox(“Incorrect password”)

would like to have onscreen keyboard popup, I do have touchscreen enabled, what should I do?

Instead of system.gui.passwordBox, try https://docs.inductiveautomation.com/display/DOC81/system.gui.showTouchscreenKeyboard, with the passwordMode parameter.

I had the same problem, and i’ve tried to use system.gui.shotTouchscreenKeyboard and i set the passwordMode to true or 1, to hide the text entered, but it’s still showing the password text on the push button.

Here is my Scrip:

	password = event.source.text = system.gui.showTouchscreenKeyboard("Modification Paramêtres",20,True)
	if password == event.source.Password:
    		system.tag.write('CLX_PLASTIQUE/EditEnable', 1)
if event.source.EditEnable== 1:
    system.tag.write('CLX_PLASTIQUE/EditEnable', 0) 

It’s a toggle Push Button to enable or disable the editable properties of few fields

Can you edit your script to place the contents inside of a code block, like below:

code block

You can create (and terminate) the code block with three backticks. It makes it a lot easier to read (and currently, it looks like there is a syntax error, but might just be formatting).

I have found an acceptable solution,

	password = event.source.text = system.gui.showTouchscreenKeyboard("<Html><center>Modification<br>Paramêtres",20,True)
	if password == event.source.Password:
    		system.tag.write('CLX_PLASTIQUE/EditEnable', 1)
    		event.source.text = "<Html><center>Modification<br>Parametres"
if event.source.EditEnable== 1:
    system.tag.write('CLX_PLASTIQUE/EditEnable', 0)

I am writing back on the push button text the original text of the push button…
Only problem is it does not translate well the frebch accents, Parameter in french is writed Paramètres
If i add the accent in the script i get weird characters ParamÀ`tres.

This line is causing you troubles:

password = event.source.text = system.gui.showTouchscreenKeyboard("Modification Paramêtres",20,True)

You’re trying to assign a variable password to the result of an assignment of system.gui.showTouchscreenKeyboard() to event.source.text (which is what places the password text on your button).

I’d suggest something like this instead:

password = system.gui.showTouchscreenKeyboard("Modification Paramêtres",20,True)
if password == ...

See this example in regular python to see why you’re getting this behavior:
2022-02-11 at 11.09 AM

Both a and b are assigned the value “c”

1 Like

Yes it worked perfectly…