Hi guys,
I have got a problem when trying to play a sub using a shortcut
key in a low keyboard hook...
Code:
    Private Shadows Sub KeyDown(ByVal KeyCode As Integer) Handles KeyHook.KeyDown
If KeyCode=keys.f12 then
Call MySub
        End If
when trying to play any of these subs by the key f12 the system freeze for a couple of seconds and the goes back to normal...
when clicking on a button that Calls the same Sub the system doesn't freeze...
The sub it calls is a loop with delay (system.threading.thread.sleep(10) )
and the Application.doevents command.

How can I fix the problem, so when I press the F12 key my system wont freeze (it doesn't happen to me when trying to call the same sub using a button)...?

Thank you!