rewrite of the gamepad dispatcher code.