Valheim
You are viewing a potentially older version of this package. View Latest Version
Install with App

Details

Date Uploaded
4 weeks ago
Downloads
472
Size
17KB
ADDatHost Valheim hosting
30% off

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 ZCursor API and applies state in LateUpdate (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

  1. Install with r2modman / Thunderstore Mod Manager (BepInExPack_Valheim required)
  2. Or place ValheimCursorLockFix.dll into BepInEx/plugins/
  3. 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 EnableFix and ForceLockInGameplay both true
  • 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.

Thunderstore development is made possible with ads. Please consider making an exception to your adblock.