How to disable F3 and F4?

RyanBram

Veteran
Veteran
Joined
May 13, 2012
Messages
232
Reaction score
266
First Language
Indonesian
Primarily Uses
RMMV
Hi,


How to disable the F3 and F4 key for stretching screen and full screen function?


I want the full screen function can only done inside menu option instead of hot key. I found the script for adjusting full screen in option, but still cannot find a way to restrict the player to use F3 and F4 for stretching screen and full screen .


For additional question,


How to make stretching as default when full screen the game inside browser instead of NWJS?


Because when fullscreen inside browser, the screen isn't stretched by default except by pressing F3.


Thanks.
 

Krimer

Veteran
Veteran
Joined
May 10, 2013
Messages
147
Reaction score
108
First Language
Ukrainian
you can try this 





But i done that pretty much long time ago and don't know how it work now. Try it and say if there are any problems or you need something else.
 
Last edited by a moderator:

RyanBram

Veteran
Veteran
Joined
May 13, 2012
Messages
232
Reaction score
266
First Language
Indonesian
Primarily Uses
RMMV
Hi, Krimer.


Many thanks for the plugin. It works with the latest MV version and I think it doesn't has any conflict with other plugins. If I can ask, I need more features, such as:

  1. Disable F4 as well. So player can only fullscreen through option;
  2. Plugin option (true or false) to choose between adding Fullscreen option in menu or not.
  3. Browser support. If MV game is played in browser (e.g. Chrome), user can choose to fullscreen it in option without need to press F4. The only problem here is Esc for menu will make the game to run windowed again in browser. Maybe there is workaround to avoid this problem.

You don't have to implement all of them if you think it isn't necessary. But if you add those features, it will be very, very useful for me.


Thanks.
 
Last edited by a moderator:

Krimer

Veteran
Veteran
Joined
May 10, 2013
Messages
147
Reaction score
108
First Language
Ukrainian
first two is ok and i add them, try it

/*=============================================================================
* Fullscreen_Options.js
*=============================================================================*/

/*:=============================================================================
* @plugindesc v1.1 Add fullscreen option, force fullscreen in Stretch Mode and disable F3.
* @author Krimer
*
* @param fullscreenOptionName
* @desc Fullscreen option name
* Default: Fullscreen
* @default Fullscreen
*
* @param forceFullscreen
* @desc Force fullscreen during first game start? true or false Default: false
* @default false
*
* @param Add command to option?
* @desc Add command to option menu? true or false Default: false
* @default false
*
* @param Disable F3?
* @desc Disable F3? and force Stretch Mode by default. true or false Default: false
* @default false
*
* @param Disable F4?
* @desc true or false Default: false
* @default false
*
* @help
* "config.rpgsave" from "save" folder must be deleted to perform clean
* first start.
* After clean first start the "config.rpgsave" would be created
* and all changes in 'Options' would be saved there.
* =============================================================================*/

(function() {

var parameters = PluginManager.parameters('Fullscreen_Options');
var fullscreenOptionName = String(parameters['fullscreenOptionName']) || 'Fullscreen';
var forceFullscreen = String(parameters['forceFullscreen']);
var fullscreenOptionCommand = String(parameters['Add command to option?']) === 'true' ? true : false;
var disable_F3 = String(parameters['Disable F3?']) === 'true' ? true : false;
var disable_F4 = String(parameters['Disable F4?']) === 'true' ? true : false;

/* Alias */
var _ConfigManager_makeData_Alias = ConfigManager.makeData;
ConfigManager.makeData = function() {
var config = _ConfigManager_makeData_Alias.call(this);
config.callFullscreen = this.callFullscreen;
return config;
};

/* Alias */
var _ConfigManager_applyData_Alias = ConfigManager.applyData;
ConfigManager.applyData = function(config) {
this.callFullscreen = this.readFlag(config, 'callFullscreen');
_ConfigManager_applyData_Alias.call(this, config);
};

/* Alias */
_Graphics_defaultStretchMode_Alias = Graphics._defaultStretchMode;
Graphics._defaultStretchMode = function() {
if (disable_F3 == true){
return true
} else {
_Graphics_defaultStretchMode_Alias.call(this)
}
};

/* Overwrite */
Graphics._onKeyDown = function(event) {
if (!event.ctrlKey && !event.altKey) {
switch (event.keyCode) {
case 113: /* F2 */
event.preventDefault();
this._switchFPSMeter();
break;
case 114: /* F3 */
if (disable_F3 == true) return;
event.preventDefault();
this._switchStretchMode();
break;
case 115: /* F4 */
if (disable_F4 == true) return;
event.preventDefault();
this._switchFullScreen();
break;
}
}
};

/* Alias */
var _Scene_Title_start_Alias = Scene_Title.prototype.start;
Scene_Title.prototype.start = function() {
if (ConfigManager.callFullscreen && StorageManager.exists(-1)) {
Graphics._requestFullScreen();
} else if (!ConfigManager.callFullscreen && StorageManager.exists(-1)) {
Graphics._cancelFullScreen();
}
if (!StorageManager.exists(-1) && eval(forceFullscreen)){
Graphics._switchFullScreen();
ConfigManager.callFullscreen = eval(forceFullscreen);
}
ConfigManager.save();
_Scene_Title_start_Alias.call(this)
};


/* Alias */
var _Window_Options_addGeneralOptions_Alias = Window_Options.prototype.addGeneralOptions;
Window_Options.prototype.addGeneralOptions = function() {
if (fullscreenOptionCommand == true) {
this.addCommand(fullscreenOptionName, 'callFullscreen');
}
_Window_Options_addGeneralOptions_Alias.call(this);
};

/* Alias */
var _Window_Options_processOk_Alias = Window_Options.prototype.processOk;
Window_Options.prototype.processOk = function() {
_Window_Options_processOk_Alias.call(this)
var index = this.index();
var symbol = this.commandSymbol(index);
if (ConfigManager.callFullscreen && symbol == "callFullscreen") {
Graphics._requestFullScreen();
} else if (!ConfigManager.callFullscreen && symbol == "callFullscreen") {
Graphics._cancelFullScreen();
}
};
})();



But browser is different thing, i don't have enough experience with browser so i can't help with that.
 

Zalerinian

Jack of all Errors
Veteran
Joined
Dec 17, 2012
Messages
4,696
Reaction score
935
First Language
English
Primarily Uses
N/A
Browsers already support fullscreen by pressing F11. You could have the nwjs version also use F11 so that you're consistent. 
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 2)

Latest Threads

Latest Profile Posts


The GIF of this seemed too cool to bury in replies. :LZSwink:
You may have slept with my aunt... but, given the circumstances, cheers.

- Professor Ian Duncan, 2013
Ami
--- Swimming ---

F.Knight: This Shrine always Flood. We don't have a choice,we have to Swimming in this place
F.Healer: That Insane!
F.Mage: We can use…Boat,rather than Swimming
F.Knight: You guys…Can't Swim?
F.Healer & F.Mage: (Shocked) Eehh??
Trying to get back, trying to get better...

Forum statistics

Threads
105,524
Messages
1,014,382
Members
137,205
Latest member
corwar_uwu
Top