Well, there's several ways to get around keypress stupidity. The most basic, of course, is to get familiar enough with the setup to avoid or decrease them. But in the case of persistent control typos and the like, there are steps you can take against it.
I haven't found a good way around z / a confusion. It's just something you have to pay attention to. You could try mapping them to different keys so they're not right next to one another. You could train yourself to open the menu each time (z?, a?) so you have to look at the available abilities / spells before casting, and so you notice if you opened the wrong menu (or you could use a macro to force the menu open each time). You could bind specific spells and abilites to their own shortcut macros, so you don't mess up the menus as all. (za and aa are easy to confuse. 1 and 2 are harder).
You've already discovered bindkey, by the sound of it. Lines of the form
bindkey = [h] CMD_NO_CMD_DEFAULT
in your init.txt / your config assign a null command to the key in brackets, so nothing happens when it's pressed. This might mess with other macros that use the keys you've disabled, though (autofight / tab is a common offender, I think).
Another possible solution is to add confirmation prompts instead of disabling the command completely. I used this macro to stop myself from accidentally hitting autoexplore when I didn't want to.
- Code:
# Adds a confirmation prompt before autoexplore. Map to o
{
function confirm_autoexplore()
crawl.formatted_mpr("Really autoexplore?", "prompt")
local res = crawl.getch()
if string.lower(string.char(res)) == "y" then
crawl.sendkeys("o")
end
end
}
You could use something similar on the vi keys if you wanted. One advantage is if you call the protected key in another function or macro, the prompt doesn't muck it up (I think. I haven't tested that extensively).
(Moving this to advice, since that's what he's asking for).