"Set Input Game Only" double click issue, suggested fixes not working

Hi Graylord,

I think I had a similar issue a while ago.
In my case I have to swith between a player mode that needs a cursor (Isometric View with cursor) and one that captures the cursor (3rd Person Character).

There are multiple input modes you can set. As far as I know you can’t interact with Widgets in FInputModeGameOnly.
I think what you need to go for is the FInputModeGameAndUI or if you wish to suppress input from action or axis mappings FInputModeUIOnly.

You can switch between input modes during gameplay. To do this, you could implement a function similar to this:

void APlayerControllerBase::SetCursorEnabled(bool bCursorEnabled)
{
	bShowMouseCursor = bCursorEnabled;

	if (bCursorEnabled)
	{
		FInputModeGameAndUI InputMode;
		InputMode.SetLockMouseToViewportBehavior(EMouseLockMode::LockInFullscreen);
		InputMode.SetHideCursorDuringCapture(false);
		SetInputMode(InputMode);
		return;
	}

	FInputModeGameOnly CombatInputMode;
	SetInputMode(CombatInputMode);
}

You can then call this via an input mapping or a function in your UI (i.e. when a button is pressed).

Hope this helps :slight_smile:

2 Likes