English 中文(简体)
是否有办法在关贸总协定中安排一次主要活动?
原标题:Is there a way to trap a keyboard event in GWT?
  • 时间:2011-10-04 11:22:52
  •  标签:
  • gwt

I m trying to trap key downs in GWT, and I ve tried both addKeyDownHandler and onBrowserEvent. The problem is that they work as long as the appropriate widget had the focus, but it stops working when something else has the focus. I could add the code to every single widget, but that seems crazy. I also tried forcing one single widget to always have the focus, but that causes other problems with things like TextBoxes (which need the focus for typing).

是否只有一种简单、高层次的方法,才能在金星在关贸总会受到压力时启动某些法典,而不论哪一种植被有重点?

最佳回答

(capture) 阶段在IEE中推广。

问题回答

Why don t you add the keyDownHandler to the body element like this and add the handler to that? All javascript events will bubble down unless you prevent it in a function().

例:

然后将它归入一个类别,使其成为Widget和AddDomHandler,如:。 或者,如果这证明不十分简单,那么简单地说,在东道网页上写上 j字,或者使用本地方法(GWT允许你用本地关键词撰写 j。)





相关问题
Refresh the UI in gwt

I have created some custom composite widget, which listens to an events (in my case loginEvent). Once the event is caught the state of the widget changes so as the way it should look (in my case I ...

How to create a development/debug and production setup

I recently deployed inadvertently a debug version of our game typrX (typing races at www.typrx.com - try it it s fun). It was quickly corrected but I know it may happen again. After digging on ...

GWT error at runtime: ....style_0 is null

My code works fine in IE 8, but on firefox 3.5, the javascript fails to load. I used firebug to figure out why, and the error I get is (GWT detailed mode) My suspicion is that some style is not ...

GWT s hosted mode not working

I ve been stumped for a while trying to figure out why my GWT demo app isn t working in hosted mode so I went back and downloaded the Google Web Toolkit again, unzipped it and simply went to the ...

How to disable Google Visualizations Tool Tips?

Does anyone know how to disable the tool-tip boxes that popup when a Google Visualizations chart is clicked (Selected)? Following the sample code at Getting Started with Visualizations, the "...

GWT 2 CssResource how to

I have a GWT 1.7 application and I want to upgrade it to GWT 2 Milestone 2. The application uses 2 big external CSS files. In GWT 1.7 I had a public folder and put both the CSS files in the folder and ...

热门标签