How to check what UI type is currently in focus

Hello,

I have a fairly complex UI system set up with lots of input fields. If none of the input fields are in focus I want to be able to handle input key events to trigger other elements. Currently when typing in an input field, if a specific character is typed that is also designated to trigger an element, that unwanted trigger occurs. Is there a way to globally check which UI type is in focus?

There seems to be something with GUI. GetNameOfFocusedControl but I cannot set these names for UI within the inspector.

Thank you for your help,
Tegan

I think that you can use currentSelectedGameObject in Event System.