Made keyCapture thread Gtk compatible