Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Key events in Firefox(Some keys don't seem to trigger key events in Firefox)
Key events in Firefox [message #534003] Mon, 17 May 2010 16:50 Go to next message
Tiber Sept is currently offline Tiber SeptFriend
Messages: 32
Registered: February 2010
Member
Hello,

so I have a text widget with a key listener that listens for the first key pressed, in order to check whether text data is really editable or not.
I can't change that behavior. In case of a positive outcome the listener removes itself.

In general, this works fine, but when the user decides to select parts of the text and presses the Delete key, the key listener is never informed
of that fact. This behavior is Firefox (3.6.3) specific, other browser like Chrome or IE do send the key event.

Is that desired behavior, am I missing something ? Qooxdoo seems to cope fine with registering the "keydown" event. Any idea of what is wrong ?

Thanks for your help in advance

Re: Key events in Firefox [message #534147 is a reply to message #534003] Tue, 18 May 2010 08:33 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi,

key listeners in RAP are there to support cell editors, we are aware
that some keys do not work correctly due to cross-browser issues. Feel
free to file a bug anyway.

Regards, Ralf

tibersept wrote:
> Hello,
>
> so I have a text widget with a key listener that listens for the first
> key pressed, in order to check whether text data is really editable or
> not. I can't change that behavior. In case of a positive outcome the
> listener removes itself.
> In general, this works fine, but when the user decides to select parts
> of the text and presses the Delete key, the key listener is never
> informed of that fact. This behavior is Firefox (3.6.3) specific, other
> browser like Chrome or IE do send the key event.
> Is that desired behavior, am I missing something ? Qooxdoo seems to
> cope fine with registering the "keydown" event. Any idea of what is wrong ?
>
> Thanks for your help in advance
>
>
Re: Key events in Firefox [message #534174 is a reply to message #534147] Tue, 18 May 2010 09:56 Go to previous messageGo to next message
Tiber Sept is currently offline Tiber SeptFriend
Messages: 32
Registered: February 2010
Member
Hi Ralf,

I've seen that the issue is not so trivial, had a look at the two KeyEventUtil
classes org.eclipse.rwt.AsyncKeyEventUtil and org.eclipse.rwt.SyncKeyEventUtil,
although I don't understand the flow exactly. I will not file a bug because the issue is well
documented.

Anyway, I need a solution and ModifyListener does not work for me, so I have extended
the RAP Text widget org.eclipse.rwt.widgets.Text and added a keydown listener. The
corresponding method checks for a specific browser + a specific key ( only if key listeners
have been added to the text widget ) and sends a Request (sendSynchronous) with
keyCode, charCode, and modifier set .

This almost works, only problem being that the the last char of the text value appears
at the selection start, so the resulting text value has to be truncated.
Could you point me to why this is happening, and, in general, to a better approach.

Thanks & Regards

[Updated on: Tue, 18 May 2010 11:25]

Report message to a moderator

Re: Key events in Firefox [message #534301 is a reply to message #534174] Tue, 18 May 2010 15:26 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi tibersept,

our KeyEvents implementation is complicated and differs between browsers
because of the fact that KeyEvents can be discarded in a Listener. I
think using a ModifyListener would be preferable, why doesn't it work
for you? Can you explain your use-case a bit more?

If you have a custom widget or some kind widget patch in Javascript you
should make sure that you have no KeyListener attached to these widgets
but use some custom communication instead because the KeyEventsUtil
interrupts the flow of events to allow for the server-side veto.

HTH, Ralf


tibersept wrote:
> Hi Ralf,
>
> I've seen that the issue is not so trivial, had a look at the two
> KeyEventUtil classes org.eclipse.rwt.AsyncKeyEventUtil and
> org.eclipse.rwt.SyncKeyEventUtil, although I don't understand the flow
> exactly. I will not file a bug because the issue is well documented.
>
> Anyway, I need a solution and ModifyListener does not work for me, so I
> have extended the RAP Text widget org.eclipse.rwt.widgets.Text and added
> a keydown listener. The corresponding method checks for a specific
> browser + a specific key ( only if key listeners have been added to the
> text widget ) and sends a Request (sendSynchronous) with keyCode,
> charCode, and modifier set .
> This almost works for the Delete key, only problem being that the the
> last char of the selection is not deleted anymore, so the resulting text
> value has to be truncated. Could you point me to why this is
> happening, and, in general, to a better approach.
>
> Thanks & Regards
Re: Key events in Firefox [message #534329 is a reply to message #534301] Tue, 18 May 2010 17:00 Go to previous message
Tiber Sept is currently offline Tiber SeptFriend
Messages: 32
Registered: February 2010
Member
Hi Ralf,

here are more details about my use case. I have a legacy system
operating behind the RAP application which requires a text widget
to always allow editing but the text value might still not be
editable. The legacy system does not provide access to that information
until the user starts editing.

With ModifyListener the user can already type a complete word
in a text widget before finding out that the text was non-editable
and seeing the typed string disappear. A KeyListener listening
for the first key pressed performs much better and the UI
in general reacts much faster with the necessary changes. That
is the whole issue.

A custom communication sounds complicated, my current
solution, although very ugly, seems to work, so I am going to
stick with it until I have more time to look at the former.

Thank you for your help and timely replies

Previous Topic:Coming soon to an incubator near you...
Next Topic:Animations
Goto Forum:
  


Current Time: Sun Dec 05 21:47:40 GMT 2021

Powered by FUDForum. Page generated in 0.01548 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top