Elie Dumas schrieb:
> Hi list,
>
> My app uses some qx.client.commands (Ctrl+N, Ctrl+S...) and an Iframe.
> But when the focus is in the Iframe, the commands cannot be executed 
> any longer, they don't react any more.
>
> For example :
>     var iframe = new qx.ui.embed.Iframe('http://www.google.com');
>     iframe.setTop(100);
>     iframe.setLeft(100);
>     iframe.setWidth(900);
>     iframe.setHeight(400);
>     d.add(iframe); 
>    
>     var command = new qx.client.Command('Ctrl+Z');
>     command.addEventListener("execute", function(e){
>         this.warn("Ctrl+Z !");
>     }, command);
>
> --> Is it a bug ?... If this is normal, how should i catch the 
> commands (shortcuts) when the focus is in the Iframe?
It's not a bug it's just a missing feature ;-) Right now the qooxdoo 
event handler is only responsible for the main document. Events on other 
documents, like iframes cannot be tracked. We are currently working on 
the event layer and in qooxdoo 0.8 we will support multiple documents.

If you really need it and aren't afraid of using qooxdoo internals you 
can force the key event handler to listen on your iframe. Alex has done 
this for the HTML editor:

  this.__doc = iframe.getContentDocument();  // iframe is an instance of 
qx.ui.embed.Iframe

  qx.html.EventRegistration.addEventListener(this.__doc, "keypress", 
qx.event.handler.KeyEventHandler.getInstance().__onkeypress);
  qx.html.EventRegistration.addEventListener(this.__doc, "keyup", 
qx.event.handler.KeyEventHandler.getInstance().__onkeyupdown);
  qx.html.EventRegistration.addEventListener(this.__doc, "keydown", 
qx.event.handler.KeyEventHandler.getInstance().__onkeyupdown);

But be warned, this is not an official API so things might break without 
warning in newer qooxdoo versions.

Best Fabian
> I would greatly appreciate any help with this...
> Thanks a lot
>
> Elie
>
> ------------------------------------------------------------------------
> Ne gardez plus qu'une seule adresse mail ! Copiez vos mails 
> <http://www.trueswitch.com/yahoo-fr/> vers Yahoo! Mail
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >>  http://get.splunk.com/
> ------------------------------------------------------------------------
>
> _______________________________________________
> qooxdoo-devel mailing list
> qooxdoo-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>   


-- 
Fabian Jakobs
JavaScript Framework Developer

1&1 Internet AG
Brauerstraße 48
76135 Karlsruhe

Amtsgericht Montabaur HRB 6484

Vorstand: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Andreas Gauger, 
Matthias Greve, Robert Hoffmann, Norbert Lang, Achim Weiss
Aufsichtsratsvorsitzender: Michael Scheeren


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to