Take a look at the ProcessKeys code in CGXBrowserGrid (gxbrowse.cpp). You might copy/paste this code to your derived grid class.