use xkeyboard to resolve input key and sleep between switching windows
to give them time to redraw