Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
ValheimCursorLockFix
Client-side cursor lock fix for Valheim. Forces cursor lock during gameplay and unlocks it in menus, inventory, build menu, map, chat and console.
By LiveriaDevs
| Last updated | 12 hours ago |
| Total downloads | 21 |
| Total rating | 1 |
| Categories | Mods |
| Dependency string | LiveriaDevs-ValheimCursorLockFix-1.0.2 |
| Dependants | 0 other packages depend on this package |
This mod requires the following mods to function
denikson-BepInExPack_Valheim
BepInEx pack for Valheim. Preconfigured and includes unstripped Unity DLLs.
Preferred version: 5.4.2202README
ValheimCursorLockFix
Client-side BepInEx 5 plugin for Valheim that keeps the hidden mouse cursor locked during gameplay. It unlocks the cursor when UI needs it, including the main menu, pause menu, inventory, build/piece menu, map, trader/store, text viewer, chat, console, text input, and when the game window is not focused.
Install with r2modman local import
- Build the package with
build.ps1. - Open r2modman and select your Valheim profile.
- Go to Settings > Import local mod.
- Select
dist/ValheimCursorLockFix-1.0.2.zip. - Launch Valheim through r2modman.
Configuration
After the first launch, edit the generated config file:
BepInEx/config/ua.gyrocopter.valheim.cursorlockfix.cfg
Available options:
EnableFix- enables or disables the fix.ForceLockInGameplay- forcesCursor.lockState = Lockedand hides the cursor during gameplay.UnlockInMenus- unlocks and shows the cursor in menus, inventory, build/piece menu, map, trader/store, text viewer, chat, console, text input, or when the window is inactive.ToggleKey- defaultF8.DebugLogging- enables extra log messages.
Toggle key
Press F8 in game to toggle the fix on or off. When disabled, the plugin releases the cursor and stops forcing the gameplay lock.
Troubleshooting
- Make sure BepInExPack Valheim is installed and enabled in the same profile.
- If the cursor still escapes, check that
EnableFixandForceLockInGameplayare bothtrue. - If the cursor flickers in the screen center, update to
1.0.2or newer. - If the cursor stays locked in UI, set
DebugLogging = true, reproduce the issue, and check the BepInEx log for the detected cursor state. - If a Valheim update changes UI APIs, this plugin uses reflection-based safe checks to avoid crashes, but a compatibility update may still be needed for changed UI behavior.