
You are viewing a potentially older version of this package. View Latest Version
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.ValheimCursorLockFix
Client-side BepInEx 5 plugin for Valheim that keeps the mouse cursor locked and hidden during gameplay, then unlocks it whenever UI needs it.
Features
- Forces cursor lock during gameplay
- Unlocks for 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
- Uses Valheim's
ZCursorAPI and applies state inLateUpdate(after the game camera) to avoid fighting the game every frame - Chat stays unlocked while the chat input field is open, with a short sticky unlock so language / IME focus blips do not clear chat selection
- Toggle in-game with F8 (configurable)
- Reflection-based UI checks so a Valheim update is less likely to hard-crash the plugin
Install
- Install with r2modman / Thunderstore Mod Manager (
BepInExPack_Valheimrequired) - Or place
ValheimCursorLockFix.dllintoBepInEx/plugins/ - Launch Valheim through your mod manager
Config
BepInEx/config/ua.gyrocopter.valheim.cursorlockfix.cfg
| Option | Default | Description |
|---|---|---|
EnableFix |
true |
Enable or disable the fix |
ForceLockInGameplay |
true |
Force locked / hidden cursor during gameplay |
UnlockInMenus |
true |
Unlock / show cursor in menus and text UI |
ToggleKey |
F8 |
Toggle the fix during play |
DebugLogging |
false |
Extra BepInEx log messages |
Troubleshooting
- Make sure BepInExPack Valheim is installed and enabled in the same profile
- If the cursor still escapes, keep
EnableFixandForceLockInGameplaybothtrue - If the hidden cursor flickers, use 1.0.3 or newer
- If chat selection drops when changing keyboard language / IME, use 1.0.3 or newer
- If the cursor stays locked in UI, set
DebugLogging = true, reproduce once, and check the BepInEx log for the detected reason
Notes
- Client-side only
- Safe to use on multiplayer as a local client mod
Changelog
See CHANGELOG.md.