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

● ARCHIVED · READ-ONLY
Started by Tinkerer 6 posts View original ↗
  1. 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).
  2. 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.
  3. 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.
  4. 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.
  5. Hi! Is there a fix to this yet? Sorry to necromancy.
  6. 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. :)
    [necro]@Darkskull [/necro]
    [mod]
    Closing.
    [/mod]