Unify handling of KeyPress/KeyRelease on Linux