Best way to do this is to give selection to your context menu when you show it. In a script on that context menu, implement OnSelected (bool isSelected) function, and if isSelected is false, close the context menu. You don't need to listen to all events for this.