Simulating Key Presses with Script Call

Hello, I need help with a script call to simulate keyboard presses. This is for RMMZ, I googled and found in the forums that it's supposed to be input.virtualclick('ok') but strangely enough, it's not working for me no matter how I tried it. Do I need a plugin for this?
JavaScript:
Input._currentState['ok'] = true

You may want to clear the Input using this code:
JavaScript:
Input.clear()

During execution of your function.
I have this plugin if the other solutions don't work. It's MV but might work in MZ
it's not working for me no matter how I tried it.
to help you find out why it doesn't work would require us to see the code where you try to use it...
This is for RMMZ, I googled and found in the forums that it's supposed to be input.virtualclick('ok')
Code is case-sensitive, try this instead: Input.virtualClick("ok");
JavaScript:
Input._currentState['ok'] = true

You may want to clear the Input using this code:
JavaScript:
Input.clear()

During execution of your function.
Hi, unfortunately this still didn't work for me.

I have this plugin if the other solutions don't work. It's MV but might work in MZ
I will try this one, hopefully it works on MZ.

[EDIT]
IT WORKS!!! THANK YOU SO MUCH!!!

to help you find out why it doesn't work would require us to see the code where you try to use it...
I tried it via common events and on an actual event on a map, autorun, parallel, not even the action button to trigger it is working.

Code is case-sensitive, try this instead: Input.virtualClick("ok");
Yes, this is how I wrote it in the script call.
1690410329166.png
This thread can be closed now, thank you 😀

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/simulating-key-presses-with-script-call.159725/