Thanks again, Wizard.
That does work for MAME. The problem is with other emulators, and since this project is a console game box ( my son calls it the GameBox. Pretty original, eh?

) I wanted to map the exit of a console emulator to a button on a gamepad. I sorta found a workaround courtesy of Minwah in his FAQs...JoyToKey. Now I can map a keypress (i.e. ESC) to a button on the keypad.
This, however, opens up a new problem. Since this is a console box, I wanted to use a console controller for all tasks. I want to keep the game box (sorry, GameBox) self-contained, with no keyboard needed. Logic dictates (at least my logic, fuzzy as it may be) that I should pick just 1 controller, and that the determinig factor should be the system being emulated that is most dependent on its controller. Therefore, I chose the N64 contoller.
(For anyone whose ever played N64's GoldenEye 007 successfully with as PS2 Dual Shock, I envy you greatly.)
Now, mapping a keypress to a button solves my exit problem. Heck, it even allows me to control Z26 exclusively from my controller. But seeing as Project 64 (the emu I use for N64) needs all the buttons on a standard N64 gamepad, I would either need to shut off JoyToKey when P64 is loaded, or find an N64-like gamepad with extra buttons.
Sorry for the long-winded post. If anyone could throw some ideas my way, I - and my son - would most appreciate it.