isTouchscreenModeEnabled not working when project launched

I am using isTouchscreenModeEnabled which works fine in preview mode is the Designer. However, when the project is launched my conditional logic that is fired in preview mode is no longer executed.

I am toggling the project to touchscreen mode when logging in, and touching on textboxes is properly displaying the on-screen keyboards as expected. So any ideas why the isTouchscreenModeEnabled function would not be returning True with a launched project?

Thanks,
Bob

Well this functionality works for me, what version of Ignition are you using? What makes you think that your script isn’t working? What/where is your script being run?

This is the script in the mouseReleased of a Button. I am getting the passwordBox when the project is launched and not the messageBox. It works fine in preview.

if system.gui.isTouchscreenModeEnabled(): system.gui.messageBox("You must re-enter the administrator user password.", "Password Confirmation") password= system.gui.showTouchscreenKeyboard("",24,1) else: password= system.gui.passwordBox("Confirm Password")

That looks pretty straightforward to me. Are there any other event scripts on that button? I’ve used an expression to test the current state.runScript("system.gui.isTouchscreenModeEnabled()",1000)

Oh wow, bad mistake on my part. A different container was being displayed when launched due to another parameter setting. So I was not actually pressing the same Button during preview as I was when launched. After figuring this out, all is fine.

Thank you for your assistance, but my apologies for taking your time.

Bob