Block or Override Alt-Enter Fullscreen

The project I’m currently working on runs at a fixed screen size of 800x600 and is deployed as a windows standalone. At that resolution though, when you switch to full screen on most monitors the image will stretch to whatever aspect ratio your monitor is. It’s ugly and not ideal, and given the project changing aspect ratio or using a more flexible base resolution won’t work.

The proper solution that I’m trying to figure out is to have a different full screen resolution from the windowed resolution, so I can pick a good resolution matching the aspect ratio. Optimally I’d just use the current desktop resolution (the project is simple enough that this is unlikely a performance issue). It should be simple to do using Screen.SetResolution, if it weren’t for one issue: Unity handles alt-enter internally to automatically and toggles to full screen with the currently used resolution.

As best I’ve looked, I can’t find a way to override this default behavior. You can’t stop it, and you can’t turn it off. The best solution I have so far is quite ugly too. When in fullscreen it checks if you’re at 800x600 and then switching to a more favorable resolution. It results in multiple resolution changes, which on some displays can take 10-15 seconds, and it messes with the position any other applications you have open.

Is there any easy way to just disable the default alt-enter functionality? If I could just handle the shortcut myself it would be perfect.

tl;dr: I want the game to have a different windowed resolution from fullscreen resolution, ideally by handling alt-enter clicks myself rather than by the unity engine.

Little update.

Unity have added the flag “Allow Fullscreen Switch” in Project Settings\Player\Resolution and Presentation.
Works perfectly.

Any answers for this question yet?
I’m currently working on a project that is not supposed to go fullscreen by software requirements and the ALT+ENTER shortcut is really getting in the way.

Thanks in advance for any help provided

function Update () {
if (Screen.fullScreen) {
Screen.fullScreen = false;
}
}

Same problem on Mac. I believe that you can do it only through the plugins and native libraries.