function TForm1.AltKeyDown : boolean; begin Result:=(Word(GetKeyState(VK_MENU)) and $8000)<>0; end; и тд.