MV Hard-Programming Plugin Function To Key

Hello!

I've been attempting to attach this plugin to the "N" key on the keyboard, so you can bring it up then leave it by pressing the key. I've already tried Yanfly's Button Common Events, and while I was able to open the plugin just fine, it would not allow me to close it with the same key. Does anyone know how to do this?

The problem I can see it running into is that it's a keyboard-input style plugin, and it might close out when the player is typing something. There are a few additional issues I've been having, namely that the plugin allows for text to go on forever, but all in due time.

Additional Information: I think I have the block of code that I could use for this, but my knowledge of JavaScript is lacking. Here--

"Scene_Notepad.prototype.checkEscapeKey = function () {
if (Input.isTriggered("escape")) {
if (this._titleWindow.active) {
this.processEscapeFromTitle();
} else if (this._detailsWindow.active) {
this.processEscapeFromDetails();
}
}
};"
Hi there!
I made an extension for you, take a look!
Press N to open(On scene map)
And press N again to close(Only works if you are not writing anything on the Notepad scene)
Hello again, and thank you so much! I genuinely didn't expect that and it works beautifully!
Glad that I can help ^^

Original thread: https://forums.rpgmakerweb.com/threads/hard-programming-plugin-function-to-key.130449/