I've apparently broken the F4 fullscreen shortcut somehow...

Hi folks, so I have been experimenting with different scripts on my fairly large project and I just recently decided against using quite a few. The only ones that did anything with Fullscreen controls are SRD's GameUpgrade and Fullscreen Toggle plugins. However, I've completely deleted both of those scripts from the Plugins folder AND removed them from the list of active Plugins in the game, but for some reason my game now launches in Fullscreen and can't be switched with F4.

The entire time I had those plugins active, the F4 toggle was still working. Now it won't.

I even tried adding orlando's F11 Fullscreen bind script, but neither F11 nor F4 worked at that point either.

I absolutely can't get this game back to where I can toggle between Fullscreen and Windowed mode. Where should I look to try to figure out what's wrong?
Does it work if you create a new project?
Did you go to the options in your game and checked is the "Fullscreen" is OFF?
Does it work if you create a new project?
Yes, all other projects including brand new ones still have the F4 toggle functionality working.

Did you go to the options in your game and checked is the "Fullscreen" is OFF?
Fullscreen isn't on my options list anymore because I removed the Fullscreen Toggle plugin. It's not in the default options as far as I am aware.
Then I'd suggest some basic troubleshooting. Turn off all plugins in your plugin manager, save the project, and launch a play test - verify it is in a normal window.

If yes, turn back on half of your plugins to see if it's one of those that causes the problem. Proceed logically until you find what's causing it - it's most likely a plugin parameter that you missed or forgot about.
Then I'd suggest some basic troubleshooting. Turn off all plugins in your plugin manager, save the project, and launch a play test - verify it is in a normal window.

If yes, turn back on half of your plugins to see if it's one of those that causes the problem. Proceed logically until you find what's causing it - it's most likely a plugin parameter that you missed or forgot about.
So I just turned every plugin to OFF and I still can't toggle the Fullscreen. It seems like something was permanently modified by one of the plugins I deleted. Would the Fullscreen controls exist somewhere in the main js files?

EDIT: I searched the .js folder and found that rpg_core is the only one that deals with Fullscreen controls, so I copied the default rpg_core file from another project just to be sure, and still no changes. 🙁
JavaScript:
Graphics._onKeyDown = function(event) {
    if (!event.ctrlKey && !event.altKey) {
        switch (event.keyCode) {
        case 113:   // F2
            event.preventDefault();
            this._switchFPSMeter();
            break;
        case 114:   // F3
            event.preventDefault();
            this._switchStretchMode();
            break;
        case 115:   // F4
            event.preventDefault();
            this._switchFullScreen();
            break;
        }
    }
};

This is the function that handles it. So you want to check whether any other plugin overwrites or edits Graphics._onKeyDown, or set a breakpoint here to make sure it's being hit when you press F4.
What's the index.html in your game directory say if you open it in a text editor?
This is the function that handles it. So you want to check whether any other plugin overwrites or edits Graphics._onKeyDown, or set a breakpoint here to make sure it's being hit when you press F4.
I just Ctrl-F'd every script for "graphics" and "fullscreen" and couldn't find any part of the code that you showed so I don't think anything I have turned on is interfering with it. I'm not sure I know what you mean about setting a breakpoint there, would you elaborate so I can try it?

EDIT: Also, FYI, I did search rpg_core for the bit of code you shared and it looks identical on my end.

What's the index.html in your game directory say if you open it in a text editor?

Here's the full text of it.

Spoiler: index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="viewport" content="user-scalable=no">
<link rel="icon" href="icon/icon.png" type="image/png">
<link rel="apple-touch-icon" href="icon/icon.png">
<link rel="stylesheet" type="text/css" href="fonts/gamefont.css">
<title>Clinky</title>
</head>
<body style="background-color: black">
<script type="text/javascript" src="js/libs/pixi.js"></script>
<script type="text/javascript" src="js/libs/pixi-tilemap.js"></script>
<script type="text/javascript" src="js/libs/pixi-picture.js"></script>
<script type="text/javascript" src="js/libs/fpsmeter.js"></script>
<script type="text/javascript" src="js/libs/lz-string.js"></script>
<script type="text/javascript" src="js/libs/iphone-inline-video.browser.js"></script>
<script type="text/javascript" src="js/rpg_core.js"></script>
<script type="text/javascript" src="js/rpg_managers.js"></script>
<script type="text/javascript" src="js/rpg_objects.js"></script>
<script type="text/javascript" src="js/rpg_scenes.js"></script>
<script type="text/javascript" src="js/rpg_sprites.js"></script>
<script type="text/javascript" src="js/rpg_windows.js"></script>
<script type="text/javascript" src="js/plugins.js"></script>
<script type="text/javascript" src="js/main.js"></script>
</body>
</html>
I just Ctrl-F'd every script for "graphics" and "fullscreen" and couldn't find any part of the code that you showed so I don't think anything I have turned on is interfering with it. I'm not sure I know what you mean about setting a breakpoint there, would you elaborate so I can try it?



Here's the full text of it.

Spoiler: index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="viewport" content="user-scalable=no">
<link rel="icon" href="icon/icon.png" type="image/png">
<link rel="apple-touch-icon" href="icon/icon.png">
<link rel="stylesheet" type="text/css" href="fonts/gamefont.css">
<title>Clinky</title>
</head>
<body style="background-color: black">
<script type="text/javascript" src="js/libs/pixi.js"></script>
<script type="text/javascript" src="js/libs/pixi-tilemap.js"></script>
<script type="text/javascript" src="js/libs/pixi-picture.js"></script>
<script type="text/javascript" src="js/libs/fpsmeter.js"></script>
<script type="text/javascript" src="js/libs/lz-string.js"></script>
<script type="text/javascript" src="js/libs/iphone-inline-video.browser.js"></script>
<script type="text/javascript" src="js/rpg_core.js"></script>
<script type="text/javascript" src="js/rpg_managers.js"></script>
<script type="text/javascript" src="js/rpg_objects.js"></script>
<script type="text/javascript" src="js/rpg_scenes.js"></script>
<script type="text/javascript" src="js/rpg_sprites.js"></script>
<script type="text/javascript" src="js/rpg_windows.js"></script>
<script type="text/javascript" src="js/plugins.js"></script>
<script type="text/javascript" src="js/main.js"></script>
</body>
</html>
If you searched *every* script, including the base ones, for those terms and didn't find anything, something has messed up your core scripts. But you mentioned copying the rpg_core.js from another project so I'm guessing you just meant in addition to the one in the core.

When I say set a breakpoint, what I mean is opening the console during test play (F8), going to the "sources" tab, navigate to rpg_core.js in the window on the left-hand side, find the line that has the branch for hitting F4, and click on any line number inside of it. You should see a little blue arrow come up. Now, any time execution of the game hits that line, the code will pause and take you back to the console, where you can step through line by line or do whatever dev/diagnostic stuff you need to.
If you searched *every* script, including the base ones, for those terms and didn't find anything, something has messed up your core scripts. But you mentioned copying the rpg_core.js from another project so I'm guessing you just meant in addition to the one in the core.
Yes, I only meant to say that I searched every Plugin script, not the base ones. I actually copied all of the base scripts back from a blank project just to be sure earlier, with no improved results.

Well I did the breakpoint like you talked about, and sure enough the line you indicated is definitely triggering when I press F4, it's just not actually changing whether the game window is fullscreen or not.
Yes, I only meant to say that I searched every Plugin script, not the base ones. I actually copied all of the base scripts back from a blank project just to be sure earlier, with no results.

Well I did the breakpoint like you talked about, and sure enough the line you indicated is definitely triggering when I press F4, it's just not actually changing whether the game window is fullscreen or not.
Okay, at that point when the breakpoint hits, click the "step into" button and it should take you to the _switchFullScreen function. Run through that line by line and make sure it's doing what it's supposed to.
Okay, at that point when the breakpoint hits, click the "step into" button and it should take you to the _switchFullScreen function. Run through that line by line and make sure it's doing what it's supposed to.
So I'm following along with you and I started doing line by line on the _switchFullScreen function, and it seems to be behaving normally - it correctly alternates between the two if/then possibilities of whether we are requesting or cancelling fullscreen, even though there's no visible evidence that either one is happening.

So I went down to the Graphics._request and Graphics._cancel functions and it seems as though the only ones that are actually triggering here are the webkitRequest and webkitCancel lines, as I've indicated in this screenshot below - the other versions (which I'm guessing are for different distribution types?) when breakpointed, never seem to actually trigger.

Correct me if my strategy is wrong, I found this by breakpointing all of the elements under these functions and found that the webkit lines were the only ones that were ever activated.

So is that something that's gonna be a hint or do I need to look somewhere else?

q1.png
So I'm following along with you and I started doing line by line on the _switchFullScreen function, and it seems to be behaving normally - it correctly alternates between the two if/then possibilities of whether we are requesting or cancelling fullscreen, even though there's no visible evidence that either one is happening.

So I went down to the Graphics._request and Graphics._cancel functions and it seems as though the only ones that are actually triggering here are the webkitRequest and webkitCancel lines, as I've indicated in this screenshot below - the other versions (which I'm guessing are for different distribution types?) when breakpointed, never seem to actually trigger.

Correct me if my strategy is wrong, I found this by breakpointing all of the elements under these functions and found that the webkit lines were the only ones that were ever activated.

So is that something that's gonna be a hint or do I need to look somewhere else?

View attachment 251036
Nah, that sounds about right, the others are for mobile/web deployments so you'll never hit them while test playing from the editor.

Have you tried rebooting your computer and/or restarting RPG Maker?
Another idea to try: delete your project's package.json file, save your project, and test?
Alright folks, thanks for all of your help, but what I ended up doing was reinstalling SRD's GameUpgrade plugin, using his settings to turn Fullscreen off, then removed the Plugin again, and for some reason now it behaves normally.

Something he put in that Plugin is apparently capable of making a permanent change to something somewhere. I don't know. But it works now.

To caethyril's credit, SRD's plugin gave me a message about package.json changing once I booted up the test play, so that may have fixed my problem had I seen their reply before trying this.

But hey, I learned a cool thing today about debugging, so, thanks Trihan.

I'll be reporting mods to close the thread. 🙂
Alright folks, thanks for all of your help, but what I ended up doing was reinstalling SRD's GameUpgrade plugin, using his settings to turn Fullscreen off, then removed the Plugin again, and for some reason now it behaves normally.

Something he put in that Plugin is apparently capable of making a permanent change to something somewhere. I don't know. But it works now.

To caethyril's credit, SRD's plugin gave me a message about package.json changing once I booted up the test play, so that may have fixed my problem had I seen their reply before trying this.

But hey, I learned a cool thing today about debugging, so, thanks Trihan.

I'll be reporting mods to close the thread. 🙂
Yeah, I'm guessing GameUpgrade modifies something in package.json that messes with how the fullscreen functionality works.

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/ive-apparently-broken-the-f4-fullscreen-shortcut-somehow.154241/