improved key-hook thread. Now the main thread has to analyze pushed key