You can PInvoke keybd_event and hold the Escape key for 5 seconds and then release:
[DllImport("user32.dll")] static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, UIntPtr dwExtraInfo); keybd_event(VK_ESCAPE, 0, 0, 0)
fardjad
source share