I am trying to write an application that would listen for events outside of my application in C# but I'm having a lot of trouble finding any information about this. The idea is to listen for a click or a focus change and at a specific time get some information about the control that the user is interacting with. I would want information such as the accessibilityID, control type, name, tree structure for that element, and any other information that might be relevant. I would like to build something like Inspect. I would then take the data and do different manipulations on it later.
Being a bit new to C# I'm not sure exactly where to look. I imagine that there should be some sort of event that would give me the information I need but I can't find it. If anyone could point me in the right direction I would really appreciate it.