Prevent scene cancel with Right Click or Back Button

Hello there!
I'm currently creating a scene (made out of Window_Selectable and Window_Base) and I want the player to exit the scene only by pressing the button I have drawn in the scene.

In the Window_Selectable part I have already a processCancel function present in which I have attempted to stop player from exiting the scene:
Code:
    Window_CardsIndex.prototype.processCancel = function() {
        Window_Selectable.prototype.processCancel.call(this);
        Window_CardsIndex.lastTopRow = this.topRow();
        Window_CardsIndex.lastIndex = this.index();
        console.log("you have exited");  // < This does not work when I right click in the window
    };

I also have a Window_CardsIndex.prototype.processTouch function present, and this is the second attempt to prevent the player from exiting the scene:
Code:
Window_CardsIndex.prototype.processTouch = function() {
    if (this.isOpenAndActive()) {
        if (TouchInput.isTriggered() && this.isTouchedInsideFrame()) {
            this._touching = true;
            this.onTouch(true);
        } else if (TouchInput.isCancelled()) {
            console.log("you have exited"); // < this does not work
            return false; // < this does not work either. The scene still can be exited normally. 
        }
        if (this._touching) {
            if (TouchInput.isPressed()) {
                this.onTouch(false);
            } else {
                this._touching = false;
            }
        }
    } else {
        this._touching = false;
    }
};


Can someone please help me with this? I want the player just to not be able to exit the scene other way than the way I have made for him. This has a gameplay purpose.

Thank you for your time!
@Hisao Shou Hmm, well, unless there is something else going on, I believe that 'Window_Selectable.prototype.processCancel.call(this)' is running the default cancel process. That line should be removed.
@Hisao Shou Hmm, well, unless there is something else going on, I believe that 'Window_Selectable.prototype.processCancel.call(this)' is running the default cancel process. That line should be removed.
I removed that line and it still does not work.
I have also tried to remove the whole Window_CardsIndex.prototype.processTouch function and no positive results.
@Hisao Shou In the scene, is there a 'setHandler' that is attached to any window that is handling 'cancel', by any chance?
@Hisao Shou In the scene, is there a 'setHandler' that is attached to any window that is handling 'cancel', by any chance?
Yes, this was the problem. I have solved it!
THANK YOU A LOT.
@Hisao Shou Nice! Glad that it was a simple fix.

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/prevent-scene-cancel-with-right-click-or-back-button.113565/