How to lock mouse in viewport in blueprint?

How to block mouse in viewport in blueprint?

Because my clicks events arent working if my mouse go outside the viewport

Hello, I actually was having issues when using “Set Input Mode Game and UI” on my BP_Player_controler, my mouse would go outside the viewport after getting items on the ground and would not lock back. So I moved it to My BP_PlayerCharacter and changed to Set Input Mode Game Only and worked better for me. Here is the example: