Hey there,
It highly depends on what your set up is and without knowing more about how your project works makes it hard to solve.
I'm guessing that your mouse controls your camera and when you open the inventory, you want it to stop controlling it? If thats the case then a simple bool check can solve that. When the user goes into the inventory (Or any menu you want this for) Set a Bool on the camera to True.
Then the camera can have a simple Bool check where as long as that bool is False, the camera is free to move otherwise disable input.
Hopefully that will help or at least point you into the right direction. If I guess wrong or didn't help try to explain the project a bit more so I can try to help again.
Thanks