Move key grab implementation to window