Custom keymapping for games?
For root you didn't specify what carrier you have, so use this Google search

For custom keymapping use Tincore Keymapper. Here is the wiki page for Tincore.

I like this app for customized controller settings. A little bit of a learning curve, but doable.