I'm trying to use CKEditor in a chat room application, where the enter button would submit the current message instead of putting in a new line.
I tried hijacking it with the "key" event, and this works great. In IE, Chrome and even Firefox.
Except that in Firefox, after the initial sending, the enter button only works if I hit enter twice. The initial time I hit it, nothing happens.
I even verified this:
In this code, every time I hit a key, the keycode is displayed in the console. Those instances when the enter key is not working, nothing gets outputted.
I tried hijacking it with the "key" event, and this works great. In IE, Chrome and even Firefox.
Except that in Firefox, after the initial sending, the enter button only works if I hit enter twice. The initial time I hit it, nothing happens.
I even verified this:
function(e){ console.log(e.data.keyCode); if(e.data.keyCode == 13) { channel.send(e.editor.getData()); e.editor.setData(""); } }
In this code, every time I hit a key, the keycode is displayed in the console. Those instances when the enter key is not working, nothing gets outputted.