I am writing a addon that shows the currently available shourtcut keys.
At the moment I am filtering the availalble shortcuts via the bpy.context region and space data and comparing those to the settings for each shortcut. I then poll each one to see if it can be called in the current context. After all this I am still getting shortcuts in the list that are not actually relevant to the current context. I am thinking this is because the active object is in a different scope/context which the C code is filtering out but I can't work out how to do this filtering.
If I could find which space the active object is in and if that was the same as the current space then show those shortcuts otherwise don't. I can't seem to find out how to find the context of the active object rather than just the current context. I hope I have been clear enough here.