Toggle Button for HUD

Hi,

I'm currently trying to do a toggle button for my HUD. To achieve this, I use Yanflys Button Common Events and SmRndDdes HUD maker. Currently, I manage to open the HUD through eventing, but release button doesn't work.

The flow should be like this:
  • - Press E -> Show HUD
  • - Release E -> Hide HUD

I'm working with common events. I simply turn the Toggle HUD switch on when I'm pressing E. Though, I cannot figure out, how I can check when the player releases the key.

Could somebody show me the way with this?

open

< HUD is on

open

<HUD is off
You don't need to check if the button is released. The only thing you need to check is if the button is still pressed.
Thank you for this. Toggle button works fluently, but only with button conditional branches. I've to figure out, what I'm doing wrong when I'm using yanflys Button Common Events plugin.
The rpg_core.js has a tree called "Input". There's a function Input.isPressed(keyName).
So you can do this:
while (Input.isPressed("e") {
your code
}

Original thread: https://forums.rpgmakerweb.com/threads/toggle-button-for-hud.81098/