Pause graphics problem

So, I am writing a plugin and it goes this way:

var gtemp_alias = Game_Temp.prototype.initialize;var scene_map_update = Scene_Map.prototype.update;var scene_battle_update = Scene_Battle.prototype.update;var pause_on_map = true;var pause_on_battle = true;var pause;function update_pause() { update_pause_execution(); update_pause_button();}function update_pause_execution() { if (!$gameTemp.pause) { return; } while(!$gameTemp.pause) { update_pauseX(); Input.update(); TouchInput.update(); Graphics.update(); }}function update_pauseX() { update_pause_button();}function check_pause() { if ($gameTemp.pause == true) { $gameTemp.pause = false; } else { $gameTemp.pause = true; } }function update_pause_button() { if (Input.isTriggered('shift')) { check_pause(); }}Game_Temp.prototype.initialize = function() { gtemp_alias.call(this); pause = false;};Scene_Map.prototype.update = function() { scene_map_update.call(this); if (pause_on_map) { update_pause(); }};Scene_Battle.prototype.update = function() { scene_battle_update.call(this); update_pause();};Question: Why does it not do anything, and why doesn't it pause like it should? Also, how can you do CTRL and F1 - F12 in the Input.isTriggered correctly?
I believe the root of your issue lies in this function:

function update_pause_execution() { if (!$gameTemp.pause) { return; } while(!$gameTemp.pause) { update_pauseX(); Input.update(); TouchInput.update(); Graphics.update(); }}The while loop's input is check when gameTemp.pause is false rather than when it's true.

Another reason may perhaps be from this:

var pause;
Code:
Game_Temp.prototype.initialize = function() {    gtemp_alias.call(this);    pause = false;};
Code:
function check_pause() {	if ($gameTemp.pause == true) {		$gameTemp.pause = false;	} else {		$gameTemp.pause = true;	}	}
I believe the "pause" variable you're defining is setting the local pause to to false, rather than one in Game_Temp (I could be wrong about this considering my JavaScript scope knowledge is pretty poor).

You can just reference your local pause variable instead rather than one started in Game_Temp. You can create one in Game_Temp by putting it in the initialize function like so:

Code:
Game_Temp.prototype.initialize = function() {    gtemp_alias.call(this);    this.pause = false;};

Original thread: https://forums.rpgmakerweb.com/threads/pause-graphics-problem.48850/