It's likely that you're registering multiple global keyboard shortcuts, all of which attempt to toggle fullscreen mode resulting in shenanigans. Why? Both the Restart and Reset to Defaults buttons cause a reload of NW.js' browser instance, which results in your scripts being evaluated again—this is normal. Your shortcuts are registered globally—i.e. outside of the instance—so they do not get reset, thus you end up registering multiple copies.
Beyond that, I'm unsure why you want global—a.k.a. system-wide—hotkeys in the first place. They're registered at the OS level, so even if your application doesn't have focus they can intercept keystrokes. Doing so could cause issues for players attempting to do something outside of your application—every time they'd hit the enter/return key your application would toggle in and out of fullscreen mode. You'd also need to unregister your hotkey before the player closed the application or that could also cause issues.
I'd suggest something like the following which will toggle fullscreen mode when the Enter/Return key is pressed without the need to register global hotkeys:
/*
Attempts to toggle fullscreen mode if the Enter/Return key is pressed.
*/
$(document).on('keydown', function (ev) {
if (ev.which === 13) { // 13 is the Enter/Return key code
var doc = window.document;
var docEl = doc.documentElement;
var requestFullscreen = docEl.requestFullscreen || docEl.mozRequestFullScreen || docEl.webkitRequestFullScreen || docEl.msRequestFullscreen;
var exitFullscreen = doc.exitFullscreen || doc.mozCancelFullScreen || doc.webkitExitFullscreen || doc.msExitFullscreen;
var fullscreenElement = doc.fullscreenElement || doc.mozFullScreenElement || doc.webkitFullscreenElement || doc.msFullscreenElement;
if (!fullscreenElement) {
requestFullscreen.call(docEl);
}
else if (exitFullscreen) {
exitFullscreen.call(doc);
}
}
});
IIRC, you'll also need the following bit of CSS as WebKit/Blink-based browser instances do stupid things with the <body> element when in fullscreen mode.
html {
background-color: #111;
}
body {
background-color: transparent;
}