[UE 5.1.1] Problem With "Game and UI" Input Mode

When game and UI input mode is active, the right mouse button is used to switch between game input and UI input. When it is held, the cursor is hidden and the player is able to move the character and turn the camera. I need a way to disable that.