LPARAMETERS nKeyCode, nShiftAltCtrl If m.nKeyCode == -1 and m.nShiftAltCtrl == 0 * your code goes here... NoDefault EndIfHowever, be aware that this won't work in the IDE with the default menu because F2 is a menu hotkey (next bookmark). It works in the EXE or if you created and executed your own menu.