What does F5 do?

And can we disable it?

(Sorry, I can't search for an answer because F5 is too short as a keyword..)
F5 refreshes the game. It can be disabled using plugins.
F5 soft resets the game.  But I'm not sure if there's a way to disable it.

Then again, I've seen people find a way to disable mouse functionality via a plugin, maybe there's sometime similar for F5.
F5 refreshes in a browser - I don't know if you can disable that - it's browser functionality.
F5 refreshes in a browser - I don't know if you can disable that - it's browser functionality.
You can override all keyboard and mouse functions. Not all functions can be overridden easily since some some functions are different from the Mac and Windows. Like it would be a terrible idea to disable exit shortcuts.

rpg_managers.js

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;        }    }};
I haven't tested it, but this should do the trick:

function disableF5(e) { if ((e.which || e.keyCode) == 116) e.preventDefault(); };document.addEventListener('keydown', disableF5);Edit: Ninja'ed
Hey guys!

Thanks for posting. I disabled that F5 function. I realize it's normal for a browser but if someone plays a game on Steam, they won't expect F5 to refresh and essentially kill their gameplay. 🙂
Just curious, I tried created a plugin called DisableF5 and pasted that line Hudell posted about but it didn't work.


Should this be used in a script file other than a new plugin?
function disableF5(e) { if ((e.which || e.keyCode) == 116) e.preventDefault(); };document.addEventListener('keydown', disableF5);Edit: Ninja'ed

I dont understand, is this supposed to be a JS plugin or a script call?
I dont understand, is this supposed to be a JS plugin or a script call?
Both ways would work.
@LadyBaskerville also made a plugin (Confirm Reload) to allow you to still keep the F5 function but it asks the player if they really want to reset the game first.
Thanks for getting back to me so soon Huddel.... I feel pretty dumb but neither way seems to have any effect on my game, thankfully it was quite easy to modify LadyBaskerville's into just disabling F5 altogether.
@TheCosmicSlug it looks like you were putting Hudell's "Edit: Ninja'ed" comment into the line. If you had removed that, it should have worked. 🙂
I thought of that, didnt seem to make any difference, not to worry you've given me a solution now, thankyou 🙂
@TheCosmicSlug it looks like you were putting Hudell's "Edit: Ninja'ed" comment into the line. If you had removed that, it should have worked. 🙂

does not work for me any way 🙁


i dont understand why MV have not included this simply and basic features.
https://forums.rpgmakerweb.com/index.php?threads/completely-disable-f5.110026/

this works btw

Original thread: https://forums.rpgmakerweb.com/threads/what-does-f5-do.52235/