How to do 'right mouse button' release like for left mouse button script TouchInput.isRealease().

I am making a game in rpg maker mz and I want to make custom menu but the problem is with right mouse button I can't figure out how to do with RMB I know script for pressing the button but there is no script for realeaseing it.

Please help and advance thankyou and sorry for my bad english.
Hi there,

AFAIK there is nothing in the code that detects "release" of the right-click so you'd need a plugin for that. Perhaps this might help?

I haven't tested it, but you can try this:
1. Inside the first conditional block, add a script command that contains this code:
JavaScript:
$gameTemp.rightPressed = true;

2. Make this the condition for the second block:
JavaScript:
$gameTemp.rightPressed && !TouchInput.isCancelled()

3. Inside the second conditional block, add a script command that contains this code:
JavaScript:
$gameTemp.rightPressed = false;

If that doesn't work, please show me an updated screenshot containing the changes I mentioned.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-do-right-mouse-button-release-like-for-left-mouse-button-script-touchinput-isrealease.163228/