digideskio / google-web-toolkit-incubator

Automatically exported from code.google.com/p/google-web-toolkit-incubator
0 stars 0 forks source link

KeyEvents don't work on Web Mode #319

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What version of gwt and gwt-incubator are you using?

- GWT 1.7
- gwt-incubator 1.7
- gxt 2.1

What OS and browser are you using?

- Windows XP Home Edition 
- Google Chrome 3.0 and Firefox 3.0 

Do you see this error in hosted mode, web mode, or both?

- The error's occur only on Web Mode... 

(If possible, please include a test case that shows the problem)

- I've done a simple app to demonstrate the issue... You can download it 
from http://dl.getdropbox.com/u/1353013/GWT_Canvas_Demo.rar. You just have 
to right setup the gxt and gwt-incubator libraries on the app built-path.

Hopefully using the test case you have generously provided, what steps will 
reproduce the problem? 
1. (I have no idea...)
2.
3.

What is the expected output? What do you see instead?

- I made a test that when the user press any key on canvas will appear a 
gxt Info widget specifiyng the event ocurred... 

Workaround if you have one:

Please provide any additional information below,  and thank you for taking 
the time and effort to report this issue, as good issue reports are 
critical for our quest to make GWT's new widgets and libraries shine.

- Unfortunately I have not any solution... I hope you can help me on this..
  Thanks a lot.
  Cheers

Original issue reported on code.google.com by cris.gon...@gmail.com on 25 Oct 2009 at 11:10

GoogleCodeExporter commented 8 years ago
Ups... just for complete the "What is the expected output?":

- I made a test that when the user press any key on canvas will appear a 
gxt Info widget specifiyng the event ocurred... 
When I test on Hosted Mode everythings works fine, for instance, if I click 
with 
mouse appears the Info Widget saying "Mouse Down - You click on Canvas" and if 
a 
press any key it appears two Info widgets saying "KeyPress - KeyPress on canvas"
and "KeyDown - KeyDown on canvas"...

But when I compile to Web Mode the mouse events works fine and the key events 
just 
don't work...

Original comment by cris.gon...@gmail.com on 25 Oct 2009 at 11:18

GoogleCodeExporter commented 8 years ago
Tested with GWT 2.0.3, gwt-incubator-20100204-r1747.jar and found this still 
not to 
be working. Added handlers for keyup, keydown and keypressed, none are called.

public class Canvas extends GWTCanvas
{
...
    public HandlerRegistration addKeyDownHandler(KeyDownHandler handler)
    {
        return addDomHandler(handler, KeyDownEvent.getType());
    }

    public HandlerRegistration addKeyUpHandler(KeyUpHandler handler)
    {
        return addDomHandler(handler, KeyUpEvent.getType()); 
    }

    public HandlerRegistration addKeyPressHandler(KeyPressHandler handler)
    {
        return addDomHandler(handler, KeyPressEvent.getType());
    }
}
...
handlers:

    public void onKeyUp(KeyUpEvent event)
    {
        Window.alert(event.toDebugString()); 
        ...
    }

    @Override
    public void onKeyDown(KeyDownEvent event)
    {
        Window.alert(event.toDebugString()); 
        ...
     }

    @Override
    public void onKeyPress(KeyPressEvent event)
    {
        Window.alert(event.toDebugString()); 
        ...
    }

Original comment by gepe...@gmail.com on 4 Apr 2010 at 8:18