This was SUCH a pain to get working for me.
What you'll want to do (or at least, how I got it working) is to create two sets of control input functions.
Your Primary input should be "Default Android TV Input"
Your Secondary input should be "OUYA Specific Input"
Watch for all buttons and input actions, and basically do a big "If something is *definitely* from an OUYA controller, then remember that this port is using an OUYA controller" thing.
Store an "IsOUYA" setting per controller port, and you *should* be good to go.
The main issue is that Forge has the Android TV layer AND the OUYA layer, whereas OUYA just had the OUYA stuff to work with. It causes a couple of quirks along the way.
As long as you aim for "Plain AndroidTV" input, then you should be able to get away with most things.
Note : Posting my code might help, but I'm using the language Monkey-X (Monkey-X.com) so it's not really compatible with a lot of other languages, I'm afraid.