Minecraft · handler “Minecraft: Java Edition”
Version 2
Release notes
multiple keyboards.
- Released
- Size
- 1.4 KB
- Downloads
- 45
- Check
- Verified
- SHA-256
- 59d4c410989110a8aa822200a11439fc35f96f53d325c401db543487ba8960b0
Files 1
| Path | Size |
|---|---|
| handler.js | 3.6 KB |
handler.js
Plain textHub.Handler.Version = 2; // Released at https://hub.splitscreen.me/ on Mon Apr 13 2020 04:46:09 GMT+0000 (UTC).
Hub.Handler.Id = "QC7TTYjjZzaQ6Y6Nw";
Hub.Maintainer.Name = "Talos91";
Hub.Maintainer.Id = "eeL7HAz8zJovChWw4";
Game.NeedsSteamEmulation = false;
Game.HandlerInterval = 100;
Game.SymlinkExe = false;
Game.SymlinkGame = false;
Game.SupportsKeyboard = false;
Game.ExecutableName = "MinecraftLauncher.exe";
Game.SteamID = "15";
Game.GUID = "Minecraft Java Edition";
Game.GameName = "Minecraft Java Edition";
Game.MaxPlayers = 16;
Game.MaxPlayersOneMonitor = 16;
Game.HideTaskbar = true;
Game.Hook.ForceFocus = false;
Game.Hook.ForceFocusWindowName = "Minecraft";
Game.HasDynamicWindowTitle = true;
Game.Hook.DInputEnabled = false;
Game.Hook.DInputForceDisable = false;
Game.Hook.XInputEnabled = true;
Game.Hook.XInputReroute = false;
Game.Hook.CustomDllEnabled = false;
Game.FakeFocus = true;
Game.FakeFocusInterval = 120;
Game.HookFocus = true;
Game.PreventGameFocus = true;
Game.RefreshWindowAfterStart = true;
Game.ForceProcessPick = true;
Game.NotTopMost = true;
Game.HideCursor = false;
Game.PauseBetweenStarts = 30;
Game.Description =
"Java version only. If you use keyboards and mice after the instances open press the END key to lock the input for all instances to have their own cursor. Press the END key again to unlock the input.";
Game.SupportsMultipleKeyboardsAndMice = true;
Game.HookSetCursorPos = true;
Game.HookGetCursorPos = true;
Game.HookGetKeyState = true;
Game.HookGetAsyncKeyState = true;
Game.HookGetKeyboardState = true;
Game.HookFilterRawInput = true;
Game.HookFilterMouseMessages = true;
Game.HookUseLegacyInput = false;
Game.HookDontUpdateLegacyInMouseMsg = false;
Game.HookMouseVisibility = false;
Game.SendNormalMouseInput = true;
Game.SendNormalKeyboardInput = true;
Game.SendScrollWheel = true;
Game.ForwardRawKeyboardInput = false;
Game.ForwardRawMouseInput = false;
Game.HookReRegisterRawInput = true;
Game.HookReRegisterRawInputMouse = true;
Game.HookReRegisterRawInputKeyboard = false;
Game.DrawFakeMouseCursor = true;
Game.LockInputAtStart = false;
Game.LockInputToggleKey = 0x23;
MakeNotReadonly = function(path) {
var oldAttr = System.IO.File.GetAttributes(path);
var newAttr = oldAttr & ~1;
System.IO.File.SetAttributes(path, newAttr);
};
MakeReadonly = function(path) {
var oldAttr = System.IO.File.GetAttributes(path);
var newAttr = oldAttr | 1;
System.IO.File.SetAttributes(path, newAttr);
};
Game.Play = function() {
var name = "Player" + Context.PlayerID;
var dotm = System.Environment.GetFolderPath(26) + "\\.minecraft";
//Kill any running Minecraft Launchers or they will use the old username.
Context.KillProcessesMatchingWindowName("Minecraft Launcher");
Context.KillProcessesMatchingProcessName("MinecraftLauncher");
//Paths
var lpfp = dotm + "\\launcher_profiles.json";
var uc = dotm + "\\usercache.json";
var unc = dotm + "\\usernamecache.json";
//Mark not readonly
MakeNotReadonly(lpfp);
MakeNotReadonly(uc);
MakeNotReadonly(unc);
//Wipe files
var emptyLines = [];
Context.WriteTextFile(uc, emptyLines);
Context.WriteTextFile(unc, emptyLines);
var usernameLineNumber = Context.FindLineNumberInTextFile(lpfp, '"displayName"', 0);
if (usernameLineNumber != -1) {
var replaceUsernameLine = [usernameLineNumber + "|" + '"displayName" : "' + name + '"'];
Context.ReplaceLinesInTextFile(lpfp, replaceUsernameLine);
}
//Mark readonly
MakeReadonly(lpfp);
MakeReadonly(uc);
MakeReadonly(unc);
};