Block keyboard inputs except for specified keys

I want to make a inventory widget that opens and closes on a press of the tab key. The user should not be able to move or interact with the world while the widget is visible but I want the game to continue. So, I thought that I should disable inputs but of course then using the tab key wont work, any suggestions on how to do this?

Check for a boolean condition isWidgetOpen for your input actions. When opened set the boolean to true and only allow tab key input.