In addition to issues I mentioned already, I don't think this works properly (or at all) for custom buttons. What will happen if custom button has common id, or several custom buttons share the same id?
Then they both will return the same id. How would you distinguish them, if they have the same id? Of course I'd write tests to also cover this, but for a basic implementation corner cases like this are not my priority. First we need to get it working, then we can worry about corner cases.
I also commented on your other points, explaining my reasoning.
Regards, Fabian Maurer