Tablet [Q] is there an app to use my device as a controller?

I ￿have an android phone and an android tablet and im a wondering if i could use my phone as a controller(sort of like bt controller but dual analogue) to play games on my tablet. any ideas?