Customizable controls

Does anyone know any way you can allow people change the key controls in the game? Basically control settings.

Basically use globals of what key is pressed then whatever key the player pressed it does what it does from what key was pressed

For binding use a click then an any keyboard key press

Ok thanks for the info.