Hi all this is a part from my script #include <Misc.au3> $dll = DllOpen("user32.dll") While 1 If _IsPressed("31", $dll) Then one() If _IsPressed("32", $dll) Then two() WEnd Func one() MsgBox(0, "", "1") While _IsPressed("31") or _IsPressed("61") Sleep(1) WEnd EndFunc Func two() MsgBox(0,"", "2") While _IsPressed("32") or _IsPressed("62") Sleep(1) WEnd EndFunc it is working fine but it takes 30 % of the CPU usage and it is a small simple script when i