Ignition Vision On screen Keyboard event script

Hi, I'm Emanuele.
I need some advice, before writing I browsed the forums, but I couldn't find a solution to my problem.

I want to write a tag when I press the enter key (not the windows keyboard) of the on-screen keyboard that appears in runtime, but I didn't find anything about it, I can only do it from the client event, but with the real keyboard that is not connected because the panel PC is only touch.

Can anyone help me?

Thanks

I don't quite understand what you're asking, but maybe this helps.

You can invoke the numeric keypad from a script:

The function is blocking, meaning script execution will not continue until the user has either pressed 'Ok' or 'Cancel' on the keypad.
So you can capture the return value in a variable, perform some validation on it, and then write it to a tag with system.tag.writeBlocking.

I want to write a tag when I press OK or Cancel on screen keypad, can I capture the Press event of the OK button?

example I want to write a string tag, if I press the OK button I write "OK", if I press Cancel I write "Cancel"

If it is possible, how can I do it?

Thanks

No, you can't add listeners or in any other way inspect what's happening while the keypad is open - it's modal, meaning all other event processing, including scripts, is paused.

The way the function works means that it will always return a value. If the user chooses to cancel, the returned value will be the same as whatever the original value was. Depending on your process, you could invoke it with some definitely-not-correct value, such as 0, and check whether the return value was 0. That's as good as you can get with the built in keypad and scripting function.

If you want more customization, you would have to make your own popup window that acts as a keypad, and be in charge of opening it whenever appropriate.