procedure TForm1.btn1Click(Sender: TObject);
begin
  mmo1.SetFocus ;
   keybd_event(VkKeyScan('n'),1,0,0);
   keybd_event(VkKeyScan('n'),1,KEYEVENTF_KEYUP,0);
   keybd_event(VkKeyScan('o'),1,0,0);
   keybd_event(vkkeyscan('o'),1,keyeventf_keyup,0);
   keybd_event(VK_RETURN,$b8,0 , 0); //  -- 按下Alt 键
   keybd_event(VK_RETURN,$b8,KEYEVENTF_KEYUP,0);//
end;

 

VOID keybd_event( BYTE bVk, BYTE bScan, DWORD dwFlags, DWORD dwExtraInfo );
4个参数都是输入参数。
bVk:键名,例如:  VK_NUMPAD7,VK_BACK, VK_TAB,VK_SHIFT,VK_F1,。。。
keybd_event(VK_MENU,0xb8,0 , 0);   -- 按下Alt 键
keybd_event(VK_MENU,0xb8,KEYEVENTF_KEYUP,0); -- 放开 Alt 键 (复位,弹上来)