Skip to content

CVR Input Field Keyboard Handler

Overrides the display behaviour of the built-in on-screen keyboard for in-world InputField and TMP_InputField components. Implements IPointerClickHandler; on a left click, either shows the CVR keyboard or suppresses it and locks keyboard input to the focused field directly.

KeyboardMode enum:

  • OpenKeyboard — the CVR keyboard opens when the field is clicked (default behaviour).
  • Disabled — the keyboard does not open; instead the cursor is unlocked and keyboard input is routed to the active input field. Submitting the field (onEndEdit) releases the input lock.
  • On Start, if the sibling input field uses MultiLineNewline, the handler bumps it to MultiLineSubmit so pressing Enter submits instead of inserting a newline. This applies to both TMP_InputField and legacy InputField.
  • In Disabled mode, clicking the field calls CursorLockManager.Instance.SetUnlockWithId(true, ...) and CVRInputManager._moduleKeyboard.InputLock.SetLock(...) so typing goes straight into the field. Submitting releases the lock.
  • In OpenKeyboard mode, clicking delegates to KeyboardManager.Instance.ShowKeyboard(...) with the current text, multi-line flag, character limit, and placeholder text pulled from the field.

CVR-GameFiles/ABI.CCK.Components/CVRInputFieldKeyboardHandler.cs