Ticket #2140 (closed Bug: fixed)

Opened 6 years ago

Last modified 3 years ago

Firefox (MacOSX): Invalid capturing of enter-key event

Reported by: hidekaz 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

fckkeystrokehandler.js (5.1 KB) - added by hidekaz 6 years ago.
fckkeystrokehandler.2.js (5.3 KB) - added by keit 6 years ago.
2140.patch (1.3 KB) - added by alfonsoml 5 years ago.
Patch version of Hidekaz file
2140_2.patch (2.4 KB) - added by alfonsoml 5 years ago.
Patch version of Keit file
2686.patch (1.4 KB) - added by alfonsoml 5 years ago.
Patch of Snak posted in #2686

Change History

Changed 6 years ago by hidekaz

comment:1 Changed 6 years ago by w.olchawa

  • Keywords HasPatch added

comment:2 Changed 6 years ago by keit

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 6 years ago by keit

Changed 5 years ago by alfonsoml

Patch version of Hidekaz file

Changed 5 years ago by alfonsoml

Patch version of Keit file

Changed 5 years ago by alfonsoml

Patch of Snak posted in #2686

comment:3 Changed 5 years ago by alfonsoml

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 3 years ago by j.swiderski

  • Status changed from new to closed
  • Resolution set to fixed

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 3 years ago by obcooltorn

Note: See TracTickets for help on using tickets.
© 2003 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy