The parameters where passed in the wrong order here: http://stackoverflow.com/questions/12955779/how-can-i-add-a-keycode-to-a-synthetic-keyboardevent-in-webkit.

The `charCode` part was needed to be used in `Strings.fromCharCode` in CodeMirror.