Disable left/right and up/down on dpad?

Using a keyboard or any controller that lets you press multiple dpad buttons at once can cause unintended results in various games. Is there a way to disable this behavior?