Viewport losing focus on mouse click

i am trying to make rts and have a focus issue with my camera. i have function

221148-switchmouse.jpg

at first i call it in controllers constructor to switch mouse on. also i have button that allows player to rotate camera. when camera is rotating i switch off cursor. when i click mouse button, game view loses it’s focus and player can’t move camera by mouse and also cant rotate it, when rotation mouse is pressed. the only way to gain focus again is to press rotation camera button ( SwitchMouse(false) called when pressing this button) and then click mouse button. code for moving camera:

221149-cameramove.jpg

getting viewport:

221150-getviewport.jpg

camera rotation:

CameraInput is FVector2d, set by mouse axis.

Could anyone explain me what i do wrong, and how to fix this?