Debug console on F12, how to move back to F8??

Status
Not open for further replies.

Tinkerer

Veteran
Veteran
Joined
Jan 21, 2017
Messages
50
Reaction score
5
First Language
Norwegian
Primarily Uses
Hi

I just noticed that the debug console now opens when you press F12. Previously it opened on F8. The problem is that I'm using HUD Maker for my project and that plugin needs to be opened using F12. So now it won't work. Is there any way to bind the debug console to F8 again?

I'm currently running MV version 1.6.1 (from Steam on Win 10).
 

Nolonar

Veteran
Veteran
Joined
Feb 18, 2018
Messages
262
Reaction score
367
First Language
French, German
Primarily Uses
RMMZ
Actually, the console still opens with F8, it just happens to now also open with F12.

Looking at the core scripts, I found the code that opens the console when pressing F8, but there's no mention of F12 at all.
The relevant code:

rpg_managers.js line 1929
Code:
SceneManager.onKeyDown = function(event) {
    if (!event.ctrlKey && !event.altKey) {
        switch (event.keyCode) {
        case 116:   // F5
            if (Utils.isNwjs()) {
                location.reload();
            }
            break;
        case 119:   // F8
            if (Utils.isNwjs() && Utils.isOptionValid('test')) {
                require('nw.gui').Window.get().showDevTools();
            }
            break;
        }
    }
};

There is not a single script that listens to keyCode 123 (which should be the code for F12).

Which means that this new behavior is related to the new version of NWJS used by MV 1.6.1
Considering that every major browser opens its console window on F12, it's likely that the new version of NWJS is mimicking that same behavior (just a guess).


So basically, you can't fix it (or it could be hard to fix). Instead, you could try to walk around the problem by making HUD Maker listen to F8 instead.

Make a plugin with this code:
Code:
SceneManager.onKeyDown = function(event) {
    if (!event.ctrlKey && !event.altKey) {
        switch (event.keyCode) {
        case 116:   // F5
            if (Utils.isNwjs()) {
                location.reload();
            }
            break;
        }
    }
};
It's the same code as above, but without the F8 listener (so F8 won't open the console).

Then open the HUD Maker plugin and search for a similar looking code, which is listening to keyCode 123 (F12), and change it to 119 (F8) instead.



PS: Out of curiosity, I deployed a project to see if I could open the console from as a regular player.
The result: I can't. This means that your players (at least the JavaScript-savvy ones) won't be able to cheat.
 
Joined
Oct 7, 2013
Messages
307
Reaction score
365
First Language
English
Primarily Uses
RMMV
I ran into this issue as well, had a feeling it was due to the new the new version of NWJS. Ill have to give this fix a try when I get home from work.
 

Tinkerer

Veteran
Veteran
Joined
Jan 21, 2017
Messages
50
Reaction score
5
First Language
Norwegian
Primarily Uses
Sadly that didn't work for me. RPG maker totally ignores the F8 button, with or without your plugin and changing the keycode in the Super Tools/HUD maker plugin.
Binding it to other F8 key's doesn't work either.
 

Darkskull

Veteran
Veteran
Joined
Sep 14, 2016
Messages
95
Reaction score
15
First Language
English
Primarily Uses
Hi! Is there a fix to this yet? Sorry to necromancy.
 

_Shadow_

Tech Magician Level:
Moderator
Joined
Mar 2, 2014
Messages
4,088
Reaction score
2,681
First Language
Greek
Primarily Uses
RMMZ
I strongly suggest you to make a brand new thread with the same question, and a link to this one, since necroposting is strictly forbidden on support questions. Thus I have to close this.
Nevermind the blue text, it is automatic, you are not into any trouble for this, just avoid necroposting in the future. :)

@Darkskull , please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.



Closing.

 
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

I THINK I have a slightly better grasp on drawing my maps now... sorta. I still need to figure out how to draw a city of sorts. I've only got the abstract going so far.
One day, I'll not have this lingering cough and we'll have another make a game stream.
A music I create while practicing E Major scale. :D
Too bad the Boss Battle Build Bout isn't also for VXAce.

Forum statistics

Threads
115,183
Messages
1,087,914
Members
149,752
Latest member
VoanjoboryMaster
Top