#2140 closed Bug (fixed)
Firefox (MacOSX): Invalid capturing of enter-key event
Reported by: | Hidekazu Kubota | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | FCKeditor 2.6 |
Keywords: | HasPatch | Cc: |
Description
Japanese users always use Japanese input method. We must type enter-key to input Japanese characters. FCKeditor unintentionally captures such key down events on Firefox2.0.0.x on MacOSX. Consequently, FCKeditor inputs <br /> or <p></p> whenever a user inputs Japanese characters.
This problem is avoided by capturing a keypress event instead of a keydown event for enter-key.
I attach patched version of fckkeystrokehandler.js for your information.
Browser: Firefox 2.0.0.14 OS: MacOSX 10.5.2
Attachments (5)
Change History (10)
Changed 17 years ago by
Attachment: | fckkeystrokehandler.js added |
---|
comment:1 Changed 17 years ago by
Keywords: | HasPatch added |
---|
comment:2 Changed 16 years ago by
Changed 16 years ago by
Attachment: | fckkeystrokehandler.2.js added |
---|
comment:3 Changed 16 years ago by
There are three possible patches, but I don't know if anyone of them is doing it right.
For starters, I don't use any IME, so I just have to rely on the description and try to understand if it can break anything.
According to Keit the patch by Hidekaz is incomplete and it won't work.
In the Keit's patch, the _FCKKeystrokeHandler_GetKeyModifiers doesn't return the calculated value, so any tests done with that patch aren't reliable.
Can someone that uses IME try to create a patch that works correctly in all the situations?
comment:4 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Here is some background. Generally, IME(Input method editor) is used to assist entering Japanese characters. User enters roman characters phonetically and IME converts the roman characters into Japanese when user hits enter key(hereafter I call this enter "Conversion Enter"). Enter key is also used as a carriage return as usual(I call this enter "Normal Enter").
I have checked it with latest CKEditor and latest browsers on Windows and MAC and everything seems to work fine.
I have the same problem with hidekaz found. I'll attach my fix as I think hidekaz's patch is incomplete. His patch is discarding all the Enter-key events including the events not to do with Japanese input method(IME).
Here is some background. Generally, IME(Input method editor) is used to assist entering Japanese characters. User enters roman characters phonetically and IME converts the roman characters into Japanese when user hits enter key(hereafter I call this enter "Conversion Enter"). Enter key is also used as a carriage return as usual(I call this enter "Normal Enter").
For the "Conversion Enter", DoEnter function should not be executed because "Conversion Enter" is just to tell IME to convert the characters being entered while the function should be executed for "Normal Enter".
In order to distinguish "Conversion Enter" and "Normal Enter", it seems that Firefox generates keydown and keypress events for "Normal Enter" but only keydown for "Conversion Enter". Inside keydown handler, there is no way to tell which enter the event is for as far as I know. This means that we need to postpone DoEnter processing until keypress event is fired(i.e. if keypress is called, the event is for normal enter so replace enter key with <p> block or whatever.)