Opened 16 years ago

Closed 13 years ago

Last modified 12 years ago

#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)

fckkeystrokehandler.js (5.1 KB) - added by Hidekazu Kubota 16 years ago.
fckkeystrokehandler.2.js (5.3 KB) - added by Kei Takashima 15 years ago.
2140.patch (1.3 KB) - added by Alfonso Martínez de Lizarrondo 15 years ago.
Patch version of Hidekaz file
2140_2.patch (2.4 KB) - added by Alfonso Martínez de Lizarrondo 15 years ago.
Patch version of Keit file
2686.patch (1.4 KB) - added by Alfonso Martínez de Lizarrondo 15 years ago.
Patch of Snak posted in #2686

Download all attachments as: .zip

Change History (10)

Changed 16 years ago by Hidekazu Kubota

Attachment: fckkeystrokehandler.js added

comment:1 Changed 16 years ago by Wojciech Olchawa

Keywords: HasPatch added

comment:2 Changed 15 years ago by Kei Takashima

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.)

Changed 15 years ago by Kei Takashima

Attachment: fckkeystrokehandler.2.js added

Changed 15 years ago by Alfonso Martínez de Lizarrondo

Attachment: 2140.patch added

Patch version of Hidekaz file

Changed 15 years ago by Alfonso Martínez de Lizarrondo

Attachment: 2140_2.patch added

Patch version of Keit file

Changed 15 years ago by Alfonso Martínez de Lizarrondo

Attachment: 2686.patch added

Patch of Snak posted in #2686

comment:3 Changed 15 years ago by Alfonso Martínez de Lizarrondo

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 13 years ago by Jakub Ś

Resolution: fixed
Status: newclosed

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.

comment:5 Changed 12 years ago by obcooltorn

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy