I'm doing some stuff with YUI menus, which is basically working fine. When I raise the menu through a keyclick on a button, I do some coloring of some DIVs to create a particular menu effect. Clicking on the button again closes the menu and undoes the coloring, and all's well.
My problem is that hitting the escape key also closes the menu, but without running undo-the-coloring code, and so I end up with some leftover gunk on the screen. How can I trap the pressing of the escape key so that I can run some code to clean up after the now-removed menu? Thanks!