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?
Simulating Key Presses with Script Call
RPG Maker MZ Support
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
Keyboard Event - RPG Maker MV
Introduction This plugin can process a keyboard event without pressing a real button within a keyboard. Plugin Commands - 'keyCode' must be number type like as 0x58 or 80 - 'keyName' should be the value for a strings that could not found in Input.keyMapper - These commands allow user to send a...
biud436.tistory.com
to help you find out why it doesn't work would require us to see the code where you try to use it...
Code is case-sensitive, try this instead:
Input.virtualClick("ok");Hi, unfortunately this still didn't work for me.
I will try this one, hopefully it works on MZ.
[EDIT]
IT WORKS!!! THANK YOU SO MUCH!!!
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.
Yes, this is how I wrote it in the script call.
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/