fix bug: cant send chat key to non minecraft window.