How to Disable a Widget?

Hey! I am not sure how to disable a specific widget on a key press mean I want to create if I press any key to disable the specific widget, I know there is Any Key Event and set visibility node but they dont work