Skip to content
Beta: this is a preview of the new SplitScreen.Me. Data may be reset before launch.

Peak · handler “PEAK Game”

Version 2

Release notes

dx11 option and changed goldberg version

Released
Size
8.8 MB
Downloads
6,797
Check
Verified
SHA-256
45c8a53da3c9e6af505ba4a3a4479e441e2bf3b2c577086ce1fc73b50ade2f4e
Download v2 (.nc)All versions

Files 94

PathSize
handler.js17 KB
Peak/steam_api64.dll17.4 MB
Peak/steam_settings/achievements.json106 KB
Peak/steam_settings/auto_accept_invite.txt0 B
Peak/steam_settings/configs.app.ini1.1 KB
Peak/steam_settings/configs.main.ini6.9 KB
Peak/steam_settings/configs.overlay.ini4.7 KB
Peak/steam_settings/configs.user.ini1.6 KB
Peak/steam_settings/img/05d979b4b8cd780c5bb1bf12defe061104d1d3c0.jpg25 KB
Peak/steam_settings/img/08c7c216ca0c200944c175bc1f03cc11f97aa327.jpg15 KB
Peak/steam_settings/img/0efa124c0b8c0744a2f02e9f79a937b54918aa5d.jpg21 KB
Peak/steam_settings/img/1977d61e0e4823a1d31066fd3370363ccd40b22e.jpg25 KB
Peak/steam_settings/img/1c7eb9a4f5e33c592fe3e205c33edcfca8fd25c1.jpg22 KB
Peak/steam_settings/img/28f03215a0f2319b684f0b740d27da8b825840ce.jpg15 KB
Peak/steam_settings/img/2c65ac4eb3bbf6bbe02d19641ef4afdbdd1d5aa1.jpg14 KB
Peak/steam_settings/img/2d29940da60a812076e97d91d82f316d981bc552.jpg15 KB
Peak/steam_settings/img/2d738f33a3d8e70ec1c5f6aa38b6dd6bc4fc1fed.jpg15 KB
Peak/steam_settings/img/2e0ab79865a23ba193abd68f9a90bcf156857b57.jpg24 KB
Peak/steam_settings/img/2ea1f88b36c6416b5bc58e3bffb7a63510eee39f.jpg16 KB
Peak/steam_settings/img/301c6a051e08bc33e68996dcb7efb2e77f4da455.jpg14 KB
Peak/steam_settings/img/40701fa821c4afaec63b4910d6508d296c28c7a7.jpg21 KB
Peak/steam_settings/img/41ce6d7161b1da52240972e63e0169007cb78b67.jpg18 KB
Peak/steam_settings/img/436bc9117a2f48012419ba39a9ccb0dedd9dffe6.jpg21 KB
Peak/steam_settings/img/437385b0e5c2930db3496429ffb06a135f21d197.jpg22 KB
Peak/steam_settings/img/43c8e5a5f436b7992d826b2eb1ee6ca5926fff4b.jpg15 KB
Peak/steam_settings/img/481d60d9e2b03849a34fdba64d0cbdcfe1fdb83d.jpg23 KB
Peak/steam_settings/img/4a796789a5819ffaa3072eea35bd24b8b217232c.jpg15 KB
Peak/steam_settings/img/4d918837219756f88b6fb411f3c6ec2b917f8523.jpg15 KB
Peak/steam_settings/img/4e73e2b07f2a04764005d864f254215da124762b.jpg16 KB
Peak/steam_settings/img/4f0bcf43f3840b7ddb1e593eec327b0f56d7ff44.jpg15 KB
Peak/steam_settings/img/502d1fe0c5605b90396cfcc17d21c19ee7232d40.jpg23 KB
Peak/steam_settings/img/50646ee6476bba68169b763a7b7f4a465c09d583.jpg12 KB
Peak/steam_settings/img/5245b05bba180da35b771da0cb768b039c38d248.jpg14 KB
Peak/steam_settings/img/52b14c9fd204fe795d8cbb61663f673b86cd1bf7.jpg13 KB
Peak/steam_settings/img/5418e39582953a08895061345a55a7182937baea.jpg12 KB
Peak/steam_settings/img/59f105343a7cda0259cfabd1992463f28dd95200.jpg25 KB
Peak/steam_settings/img/5f6f1907569a33eb62aebf8d0c75e66db5509549.jpg14 KB
Peak/steam_settings/img/623990845edc6b7e7a3591a543923a0507356490.jpg16 KB
Peak/steam_settings/img/6541523d91357a00bb49e24567429de6505ddcd3.jpg21 KB
Peak/steam_settings/img/68f452a9898f794532f05cb6167122dba64dfb57.jpg22 KB
Peak/steam_settings/img/6a51615469153bf8c206044c3c2190fe34e2cd12.jpg25 KB
Peak/steam_settings/img/6ee281715373d8c3ce5ebb20196c5ef8d92d8dd6.jpg27 KB
Peak/steam_settings/img/750fa026d893468b272b36506aa455ea64692b02.jpg28 KB
Peak/steam_settings/img/7687e0907862bf82f0d64161bfbd9fa548482e32.jpg24 KB
Peak/steam_settings/img/7904cc232eac6ffb345a96f2a265b1db4c1c535e.jpg25 KB
Peak/steam_settings/img/7b9dca4f5bd14effe9605284fad4e54bf42bbdd7.jpg19 KB
Peak/steam_settings/img/7d7633df25696d11b458fe294d5d00791243e9e0.jpg14 KB
Peak/steam_settings/img/7df1b695aa8618de20684d3ac3b155da1e4094cd.jpg13 KB
Peak/steam_settings/img/7e05f985fbd08bafb766314917b5cd857c6c2a7a.jpg14 KB
Peak/steam_settings/img/7e2752b0fd334c62fa8e9c33f94ff148900c1310.jpg16 KB
Peak/steam_settings/img/872c6763d6463af921c3553d21e7bccba00f35d3.jpg13 KB
Peak/steam_settings/img/8a4dc7bbf6d10ac13a7d55ad16ff21c1c5c61c2d.jpg21 KB
Peak/steam_settings/img/8ae93a068c402d8c43241e19b302171050c0050f.jpg24 KB
Peak/steam_settings/img/8c3fe3d2eb49cb6d920cb2cdcf2aa6f2cb2b3167.jpg15 KB
Peak/steam_settings/img/8d3b6538701b338c533edd21f6f96438ccbb5e27.jpg13 KB
Peak/steam_settings/img/8d759e3de8c3e1e04c7e22e1b68990b57004a5e9.jpg24 KB
Peak/steam_settings/img/9757dbabadd3711df0ad3706383b36375d210dbd.jpg22 KB
Peak/steam_settings/img/97cb4ca98da4fccf015d3dd893937b3a9172f62e.jpg22 KB
Peak/steam_settings/img/9efd678cc3413b567b9883504ca5c99588703857.jpg15 KB
Peak/steam_settings/img/ab56546a2cfee6dfa80ec72ed2ce832cb14c3f8b.jpg15 KB
Peak/steam_settings/img/ad231c9a8244dbe6fd7a2b722c2068719e499be4.jpg15 KB
Peak/steam_settings/img/adf04113ad409279bd2733d6ecc2504b96dc43a1.jpg21 KB
Peak/steam_settings/img/ae8905110ad33ae398a0d21a82fe1f307064c5fb.jpg16 KB
Peak/steam_settings/img/b2f575c4e2561ccf7a4e90a70fab138d84f0c1c1.jpg25 KB
Peak/steam_settings/img/b49a0c2aa5bb652c2e6ecfdc57ccc28d49e33f39.jpg15 KB
Peak/steam_settings/img/b6352212350b1281e5949a6524009ecfaffd303a.jpg15 KB
Peak/steam_settings/img/b6712f9c8113a1a7c66ebf4c685ca41f06aab598.jpg16 KB
Peak/steam_settings/img/b718db38a9d552456b69608abb21712a00a17ccf.jpg15 KB
Peak/steam_settings/img/bb7847efa4f3fdc753bd30688f557afb3b5a9b07.jpg15 KB
Peak/steam_settings/img/c209aa569e2f24ced48efc7f7d0fcfb8929ddcce.jpg15 KB
Peak/steam_settings/img/c5854c1a8b4ac4900e7f04e2b24968c95da16a9e.jpg24 KB
Peak/steam_settings/img/ca74df980945b5ad9b1aefc8bf61686c7cee0be4.jpg11 KB
Peak/steam_settings/img/cd4367de9dca4e160bdf86297d7e9003cb791c74.jpg27 KB
Peak/steam_settings/img/cf50593ed35f663e76581042aa9e248ca42118bb.jpg14 KB
Peak/steam_settings/img/d370dcb90349afee0020fe3e3bb919f9f35c5092.jpg23 KB
Peak/steam_settings/img/d8e491ed5b6489b4b9c44cca9b0d8422267a8a53.jpg24 KB
Peak/steam_settings/img/da9184f21ff1dae46b4de56ffda9a9458c4bfa09.jpg28 KB
Peak/steam_settings/img/db26b798708456a4c06328660ec67d04712f39b2.jpg23 KB
Peak/steam_settings/img/dc55f05cead6da8fc6d7534a06420ab085095dab.jpg14 KB
Peak/steam_settings/img/de12d278a0764bf904a5f70bd0d5a0ce248c078d.jpg25 KB
Peak/steam_settings/img/e09d312cab58be2b5765a63772f77fe19f5d0c77.jpg22 KB
Peak/steam_settings/img/e1e3550680fdce7c09093f29f2c9b205f737f4b4.jpg21 KB
Peak/steam_settings/img/e54c31508e016e0599a54dc344cd63a50cf04a00.jpg26 KB
Peak/steam_settings/img/e581cbc6f3483ff5ac80ee9cbfe2f541d9e4a3a6.jpg19 KB
Peak/steam_settings/img/e748ca99706ac0b09ae5328747b13e6a1d2d42bf.jpg25 KB
Peak/steam_settings/img/ec338a888bb02b501e139b3f5184a83c1589a0d5.jpg27 KB
Peak/steam_settings/img/eeb6a1de90fdd7ad1185aed32e2b086883fb762c.jpg21 KB
Peak/steam_settings/img/f0a1dda89831d0d613b9b73a8f32d96f417b54c0.jpg14 KB
Peak/steam_settings/img/f2b577c84bea7f45ccc79ca2ccb2adcc2b99e120.jpg23 KB
Peak/steam_settings/img/f3b16344af02078e58510412f68f07f5a3bef554.jpg15 KB
Peak/steam_settings/img/fea95e0fefe5fcd5517b88f29554aab4f2435e29.jpg15 KB
Peak/steam_settings/img/ffee535eef452f0542338d9208bbeb74d092928b.jpg13 KB
Peak/steam_settings/stats.json2.3 KB
Peak/steam_settings/steam_appid.txt7 B

handler.js

Plain text
Hub.Handler.Version = 2; // Released at https://hub.splitscreen.me/ on Mon Sep 08 2025 23:00:15 GMT+0000 (Coordinated Universal Time).
Hub.Handler.Id = "rLSxwziuvTcuF3GTp";
Hub.Maintainer.Name = "Talos91";
Hub.Maintainer.Id = "eeL7HAz8zJovChWw4";

var answers = ["DX11", "DX12", "Vulkan"];
Game.AddOption("Select Graphics API:", "Select the GAPI you want the game to use.", "GAPI", answers);

Game.ExecutableContext = ["PEAK_Data"];
Game.DirSymlinkExclusions = ["PEAK_Data\\Plugins\\x86_64"];
Game.FileSymlinkExclusions = ["steam_api64.dll", "steam_appid.txt", "xinput1_3.dll", "xinput1_4.dll"];
Game.FileSymlinkCopyInstead = [
  "D3D12Core.dll",
  "UnityCrashHandler64.exe",
  "UnityPlayer.dll",
  "version.txt",
  "unity default resources",
  "unity_builtin_extra",
  "UnityServicesProjectConfiguration.json",
  "app.info",
  "boot.config",
  "globalgamemanagers",
  "sharedassets0.assets",
  "sharedassets0.assets.resS",
  "sharedassets0.resource",
  "sharedassets1.assets",
  "sharedassets1.assets.resS",
  "sharedassets1.resource",
  "sharedassets2.assets",
  "sharedassets2.assets.resS",
  "sharedassets3.assets",
  "sharedassets3.assets.resS",
  "sharedassets3.resource",
  "sharedassets4.assets",
  "sharedassets4.assets.resS",
  "sharedassets4.resource"
];
Game.GameName = "PEAK";
Game.HandlerInterval = 100;
Game.SymlinkExe = false;
Game.SymlinkGame = true;
Game.SymlinkFolders = false;
Game.ExecutableName = "PEAK.exe";
Game.SteamID = "3527290";
Game.CreateSteamAppIdByExe = true;
Game.GUID = "PEAK";
Game.MaxPlayers = 4;
Game.MaxPlayersOneMonitor = 4;
Game.UseNucleusEnvironment = true;
Game.UseGoldberg = false;
Game.Hook.ForceFocus = true;
Game.Hook.ForceFocusWindowName = "PEAK";
Game.HasDynamicWindowTitle = true;
Game.RefreshWindowAfterStart = true;
Game.ResetWindows = true;
Game.Hook.DInputEnabled = false;
Game.Hook.XInputEnabled = false;
Game.Hook.XInputReroute = false;
Game.XInputPlusDll = ["xinput1_3.dll", "xinput1_4.dll"];
Game.Hook.CustomDllEnabled = false;
Game.BlockRawInput = false;
Game.UserProfileSavePath = "AppData\\Roaming\\GSE Saves\\3527290";
//Game.UserProfileConfigPath = "AppData\\LocalLow\\LandCrab";
Game.UserProfileSavePathNoCopy = true;
Game.UserProfileConfigPathNoCopy = true;
Game.Description =
  "IMPORTANT: Host a co-op game in one instance and use the invite kiosk to invite the others, an invite overlay should appear, click on invite all with your main mouse cursor. Disable any external overlays (like msi after burner or the nvidia overlay) if the invite overlay is not showing. If you use keyboards and mice after all the instances have launched, resized and positioned correctly, press the END key once to lock the input for all instances to have their own working cursor and keyboard, you need to left click each mouse to make the emulated cursors appear after locking the input. Press the END key again to unlock the input when you finish playing.";
Game.PauseBetweenProcessGrab = 20;
Game.PauseBetweenStarts = 30;

//USS deprecated options:

Game.HookSetCursorPos = false;
Game.HookGetCursorPos = false;
Game.HookGetKeyState = false;
Game.HookGetAsyncKeyState = false;
Game.HookGetKeyboardState = false;
Game.HookFilterRawInput = false;
Game.HookFilterMouseMessages = false;
Game.HookUseLegacyInput = false;
Game.HookDontUpdateLegacyInMouseMsg = false;
Game.HookMouseVisibility = false;

Game.SendNormalMouseInput = false;
Game.SendNormalKeyboardInput = false;
Game.SendScrollWheel = false;
Game.ForwardRawKeyboardInput = false;
Game.ForwardRawMouseInput = false;
Game.HookReRegisterRawInput = false;
Game.HookReRegisterRawInputMouse = false;
Game.HookReRegisterRawInputKeyboard = false;
Game.DrawFakeMouseCursor = false;

//ProtoInput:

Game.SupportsMultipleKeyboardsAndMice = true;

Game.ProtoInput.InjectStartup = false;
Game.ProtoInput.InjectRuntime_RemoteLoadMethod = false;
Game.ProtoInput.InjectRuntime_EasyHookMethod = true;
Game.ProtoInput.InjectRuntime_EasyHookStealthMethod = false;

Game.LockInputAtStart = false;
Game.LockInputSuspendsExplorer = true;
Game.ProtoInput.FreezeExternalInputWhenInputNotLocked = false;
Game.LockInputToggleKey = 0x23;

Game.ProtoInput.RenameHandlesHook = false;
Game.ProtoInput.RenameHandles = [];
Game.ProtoInput.RenameNamedPipes = [];

Game.ProtoInput.RegisterRawInputHook = true;
Game.ProtoInput.GetRawInputDataHook = true;
Game.ProtoInput.MessageFilterHook = true;
Game.ProtoInput.GetCursorPosHook = false;
Game.ProtoInput.SetCursorPosHook = false;
Game.ProtoInput.GetKeyStateHook = false;
Game.ProtoInput.GetAsyncKeyStateHook = false;
Game.ProtoInput.GetKeyboardStateHook = false;
Game.ProtoInput.CursorVisibilityHook = false;
Game.ProtoInput.ClipCursorHook = true;
Game.ProtoInput.FocusHooks = false;
Game.ProtoInput.DrawFakeCursor = false;
Game.ProtoInput.ClipCursorHookCreatesFakeClip = false;
Game.ProtoInput.EnableToggleFakeCursorVisibilityShortcut = false;
Game.ProtoInput.DontShowCursorWhenImageUpdated = true;

Game.ProtoInput.RawInputFilter = false;
Game.ProtoInput.MouseMoveFilter = false;
Game.ProtoInput.MouseActivateFilter = false;
Game.ProtoInput.WindowActivateFilter = false;
Game.ProtoInput.WindowActvateAppFilter = false;
Game.ProtoInput.MouseWheelFilter = false;
Game.ProtoInput.MouseButtonFilter = false;
Game.ProtoInput.KeyboardButtonFilter = false;

Game.ProtoInput.SendMouseWheelMessages = true;
Game.ProtoInput.SendMouseButtonMessages = true;
Game.ProtoInput.SendMouseMovementMessages = true;
Game.ProtoInput.SendKeyboardButtonMessages = true;
Game.ProtoInput.XinputHook = true;
Game.ProtoInput.UseOpenXinput = true;
Game.ProtoInput.UseDinputRedirection = false;
Game.ProtoInput.DinputDeviceHook = false;
Game.ProtoInput.DinputHookAlsoHooksGetDeviceState = false;
Game.ProtoInput.MultipleProtoControllers = false;

Game.ProtoInput.EnableFocusMessageLoop = false;
//Game.ProtoInput.FocusLoopIntervalMilliseconds = 40000;
//Game.ProtoInput.FocusLoop_WM_ACTIVATE = true;
//Game.ProtoInput.FocusLoop_WM_ACTIVATEAPP = true;
//Game.ProtoInput.FocusLoop_WM_NCACTIVATE = true;
//Game.ProtoInput.FocusLoop_WM_SETFOCUS = true;
//Game.ProtoInput.FocusLoop_WM_MOUSEACTIVATE = true;
Game.ProtoInput.BlockedMessages = [0x0008, 0x02a3, 0x02a1]; //Blocks WM_KILLFOCUS, WM_MOUSEHOVER and WM_MOUSELEAVE.

Game.Play = function() {
  var gapi = Context.Options["GAPI"];

  if (gapi == "DX12") {
    Context.StartArguments = "-windowed" + " -screen-width " + Context.Width + " -screen-height " + Context.Height;
  }

  if (gapi == "DX11") {
    Context.StartArguments = "-windowed -force-d3d11" + " -screen-width " + Context.Width + " -screen-height " + Context.Height;
  }

  if (gapi == "Vulkan") {
    Context.StartArguments = "-windowed -force-vulkan" + " -screen-width " + Context.Width + " -screen-height " + Context.Height;
  }

  Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\LandCrab\\PEAK", "FULLSCREEN_MODE_h3940033702", 1, Nucleus.RegType.DWord);

  Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\LandCrab\\PEAK", "Screenmanager Fullscreen mode_h3630240806", 3, Nucleus.RegType.DWord);

  Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\LandCrab\\PEAK", "Screenmanager Resolution Height_h2627697771", Context.Height, Nucleus.RegType.DWord);

  Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\LandCrab\\PEAK", "Screenmanager Resolution Width_h182942802", Context.Width, Nucleus.RegType.DWord);

  Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\LandCrab\\PEAK", "Screenmanager Window Position X_h4088080503", Context.PosX, Nucleus.RegType.DWord);

  Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\LandCrab\\PEAK", "Screenmanager Window Position Y_h4088080502", Context.PosY, Nucleus.RegType.DWord);

  var SW = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\PEAK_Data\\Plugins\\x86_64";

  var filePath = SW + "\\steam_settings\\mods";
  System.IO.Directory.CreateDirectory(filePath);

  Context.CopyFolder(Context.ScriptFolder + "\\steam_settings", SW + "\\steam_settings");

  var savePath = (Context.SavePath = SW + "\\steam_api64.dll");
  var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "steam_api64.dll");
  System.IO.File.Copy(savePkgOrigin, savePath, true);

  var savePath = SW + "\\steam_settings\\configs.user.ini";
  Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [
    new Nucleus.IniSaveInfo("user::general", "account_name", Context.Nickname),
    new Nucleus.IniSaveInfo("user::general", "account_steamid", Context.PlayerSteamID),
    new Nucleus.IniSaveInfo("user::general", "language", Context.SteamLang)
  ]);

  var dllPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\UnityPlayer.dll";
  var searchPattern = "57 00 69 00 6E 00 64 00 6F 00 77 00 73 00 2E 00 47 00 61 00 6D 00 69 00 6E 00 67 00 2E 00 49 00 6E 00 70 00 75 00 74 00 2E 00 47 00 61 00 6D 00 65 00 70 00 61 00 64";
  var patchPattern = "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00";
  Context.PatchFileFindPattern(dllPath, dllPath, searchPattern, patchPattern, true);

  if (Context.PlayerID == 0) {
  } else {
    var fillPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\PEAK_Data\\globalgamemanagers";
    var base = Context.Nickname;
    var og_Path = "PEAK";
    //Create newPath by rearranging characters from base
    var newPath = og_Path.substring(0, og_Path.length - 3) + base.charAt(0) + base.charAt(base.length - 1) + base.length;

    //Ensure newPath is at least as long as og_Path
    if (newPath.length < og_Path.length) {
      while (newPath.length < og_Path.length) {
        newPath += base.charAt(base.length - 1);
      }
    } else if (og_Path.length < newPath.length) {
      //Ensure og_Path is at least 3 characters long
      newPath = newPath.substring(0, og_Path.length);
    }
    Context.PatchFile(fillPath, fillPath, og_Path, newPath);

    var appInfoPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\PEAK_Data\\app.info";
    Context.PatchFile(appInfoPath, appInfoPath, og_Path, newPath);

    Context.EditRegKeyNoBackup("HKEY_CURRENT_USER", "SOFTWARE\\LandCrab\\" + newPath, "FULLSCREEN_MODE_h3940033702", 1, Nucleus.RegType.DWord);
    Context.EditRegKeyNoBackup("HKEY_CURRENT_USER", "SOFTWARE\\LandCrab\\" + newPath, "Screenmanager Fullscreen mode_h3630240806", 3, Nucleus.RegType.DWord);
    Context.EditRegKeyNoBackup("HKEY_CURRENT_USER", "SOFTWARE\\LandCrab\\" + newPath, "Screenmanager Resolution Height_h2627697771", Context.Height, Nucleus.RegType.DWord);
    Context.EditRegKeyNoBackup("HKEY_CURRENT_USER", "SOFTWARE\\LandCrab\\" + newPath, "Screenmanager Resolution Width_h182942802", Context.Width, Nucleus.RegType.DWord);
    Context.EditRegKeyNoBackup("HKEY_CURRENT_USER", "SOFTWARE\\LandCrab\\" + newPath, "Screenmanager Window Position X_h4088080503", Context.PosX, Nucleus.RegType.DWord);
    Context.EditRegKeyNoBackup("HKEY_CURRENT_USER", "SOFTWARE\\LandCrab\\" + newPath, "Screenmanager Window Position Y_h4088080502", Context.PosY, Nucleus.RegType.DWord);
  }

  if (Context.NumControllers < 5) {
    //><

    Game.ProtoInput.XinputHook = false;
    Game.ProtoInput.UseOpenXinput = false;
  } else {
    System.IO.File.Delete(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\xinput1_3.dll");

    System.IO.File.Delete(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\xinput1_4.dll");

    Game.ProtoInput.XinputHook = true;
    Game.ProtoInput.UseOpenXinput = true;
    Game.ProtoInput.MultipleProtoControllers = true;

    var numPlayers = 0;

    for (var i = 0; i < PlayerList.Count; i++) {
      var player = PlayerList[i];

      if (player.IsXInput && player.ScreenIndex !== -1) {
        numPlayers++;
      }
      player.ProtoController1 = Context.GamepadId;
      player.ProtoController2 = Context.GamepadId;
      player.ProtoController3 = Context.GamepadId;
      player.ProtoController4 = Context.GamepadId;
      player.ProtoController5 = Context.GamepadId;
      player.ProtoController6 = Context.GamepadId;
      player.ProtoController7 = Context.GamepadId;
      player.ProtoController8 = Context.GamepadId;
      player.ProtoController9 = Context.GamepadId;
      player.ProtoController10 = Context.GamepadId;
    }
  }

  Game.ProtoInput.OnInputLocked = function() {
    for (var i = 0; i < PlayerList.Count; i++) {
      var player = PlayerList[i];

      ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetCursorPosHookID);
      ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.SetCursorPosHookID);
      ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetKeyStateHookID);
      ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetAsyncKeyStateHookID);
      ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetKeyboardStateHookID);
      ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.CursorVisibilityStateHookID);
      //ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetRawInputDataHookID);
      //ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.RegisterRawInputHookID);
      //ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.MessageFilterHookID);

      //ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseMoveFilterID);

      //ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.FocusHooksHookID);

      ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.RawInputFilterID);
      ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseActivateFilterID);
      ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.WindowActivateFilterID);
      ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.WindowActivateAppFilterID);
      ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseWheelFilterID);
      ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseButtonFilterID);
      ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.KeyboardButtonFilterID);

      ProtoInput.SetDrawFakeCursor(player.ProtoInputInstanceHandle, true);

      ProtoInput.SetRawInputBypass(player.ProtoInputInstanceHandle, false);

      ProtoInput.StartFocusMessageLoop(player.ProtoInputInstanceHandle, 0, true, true, false, false, false);

      System.Threading.Thread.Sleep(1000);

      ProtoInput.StopFocusMessageLoop(player.ProtoInputInstanceHandle);
    }
  };

  Game.ProtoInput.OnInputUnlocked = function() {
    for (var i = 0; i < PlayerList.Count; i++) {
      var player = PlayerList[i];

      ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetCursorPosHookID);
      ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.SetCursorPosHookID);
      ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetKeyStateHookID);
      ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetAsyncKeyStateHookID);
      ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetKeyboardStateHookID);
      ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.CursorVisibilityStateHookID);
      //ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetRawInputDataHookID);
      //ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.RegisterRawInputHookID);
      //ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.MessageFilterHookID);

      //ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.FocusHooksHookID);

      ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.RawInputFilterID);
      ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseMoveFilterID);
      ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseActivateFilterID);
      ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.WindowActivateFilterID);
      ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.WindowActivateAppFilterID);
      ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseWheelFilterID);
      ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseButtonFilterID);
      ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.KeyboardButtonFilterID);

      ProtoInput.SetDrawFakeCursor(player.ProtoInputInstanceHandle, false);

      ProtoInput.SetRawInputBypass(player.ProtoInputInstanceHandle, true);
    }
  };
};