MV Open and close inventory easily with "Q"

Hi! This is my first time posting here and I'm a complete beginner when it comes to coding so I apologize if this isn't the correct place or if this is poorly worded.

Is there a plugin to make it so that when players press "Q" it opens up their inventory, and when they press "Q" again it closes it?
There are multiple ways to do so, this is just one of them:

Here's a small plugin that I made (right-click, save as...): https://downloads.aerosys.blog/plugins/MK_HotKeys.js

This plugin lets you bind a Common Event to a HotKey, so it's also useful in many other cases. And if you don't like mine, there are also many others out there.

Anyway, you need a Common Event (those are defined in the database). Call it something like "Open Item Menu". In this Event, you put just one Script Call (Tab 3 -> advanced) and paste this:

Code:
SceneManager.push(Scene_Item)

Remember the ID of your Common Event or note it down on a sheet of paper. We need it later.

Next, you need to find out the keycode of the letter Q. It's 81. You can look them up on this site: https://keyjs.dev/

Finally, you can use both script calls in any eventing to enable or disable this function:

Code:
$gameSystem.registerHotKey(81, 1) // Bind letter code 81 (Q) to Common Event 1
$gameSystem.unregisterHotKey(81) // Unbind letter code 81 (Q)
Replace the number 1 with your Common Event ID.
you can also YEP_Keyboard to change X (cancel) to Q (page up).
to achieve the same effect

Mine SDJB_UnifiedFusionBridge can replace buttons or set buttons
X to cancel, Q to cancel, add or remove (this require to configure
plugin itself, and can use multiple buttons to trigger something
to get a "hidden menu" or "debug menu" you can create.

so you have many opens to use, you can search for keyboard rebind,
or how you want to open the menu or inventory.
There are multiple ways to do so, this is just one of them:

Here's a small plugin that I made (right-click, save as...): https://downloads.aerosys.blog/plugins/MK_HotKeys.js

This plugin lets you bind a Common Event to a HotKey, so it's also useful in many other cases. And if you don't like mine, there are also many others out there.

Anyway, you need a Common Event (those are defined in the database). Call it something like "Open Item Menu". In this Event, you put just one Script Call (Tab 3 -> advanced) and paste this:

Code:
SceneManager.push(Scene_Item)

Remember the ID of your Common Event or note it down on a sheet of paper. We need it later.

Next, you need to find out the keycode of the letter Q. It's 81. You can look them up on this site: https://keyjs.dev/

Finally, you can use both script calls in any eventing to enable or disable this function:

Code:
$gameSystem.registerHotKey(81, 1) // Bind letter code 81 (Q) to Common Event 1
$gameSystem.unregisterHotKey(81) // Unbind letter code 81 (Q)
Replace the number 1 with your Common Event ID.

Thank you so much for replying and using simple terms with me I appreciate it!! I apologize but I seem to be having trouble getting this to work. Is the last part meant for any event on the map? Or is there a trigger or something I'm supposed to be using? Sorry I tried different methods but I'm still a bit lost
That could be anything!
It could be an NPC that tells you "Hey, now you can use your inventory by pressing Q", or it could be a blank event (= no character sprite) on your first map with its trigger set to "Autostart" so the eventing immediately starts when the game starts (just don't forget to erase this event, because autostart-events block the player from playing). There are also some plugins that auto-run a Common Event on game start. Maybe not the approach I recommend to a beginner, but as you can see, you have multiple options to choose from.

I can also extend my keyboard plugin so it auto-binds on game start, if you’d like 🙂
That would be lovely if possible thank you so much
I uploaded a new version in which you can register hot keys in the Plugin Manager. That should make it a bit easier.

Don't forget that my plugin only runs when you are on the map, not in the menus. If you really want Q to leave the item menu, then you have to look for something else.
Thank you so much for the help and being patient with me!!

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/open-and-close-inventory-easily-with-q.179416/