Reset special keys in case of window switching. Fixes issue #268.