Hello everybody,
I want to use F-Keys for a certain functionality in my Application. It is a RAP 
application, but that should not affect my problem. On the browser side I 
listen to keydown events and notify the server side if a key is pressed. To 
supress the browser processing I call keyEvent#preventDefault(), below is the 
javascript that implements the described behaviour. On Firefox it works quite 
well, but the same in IE shows the help window (F1), the search dialog (F3) or 
drops down the URL combo (F4) when the keys are pressed. Is there any way to 
suppress IE's handling of these events?

Regards,
Björn

Javascript code of the custom widget:
-------------------------------------
qx.Class.define( "my.product.internal.workbench.keybinding.KeyBinding", {
  extend : qx.ui.layout.CanvasLayout,

  construct : function() {
    this.base( arguments );
    var doc = qx.ui.core.ClientDocument.getInstance();
    doc.addEventListener( "keydown", this._onKeyDown, this );
  },

  properties : {
    interestingKeys : {
      init : "",
      apply : "setInteresting"
    }
  },

  members : {

    _onKeyDown : function( e ) {
      this.debug("identifier: " + e.getKeyIdentifier());
      // TODO: parse interesting keys and consider modifiers
      var modifier = "";
      if (e.isShiftPressed())
          modifier += "SHIFT";

      if (e.isCtrlPressed())
          modifier += "CTRL";

      if (e.isAltPressed())
          modifier += "ALT";

      if (e.isMetaPressed())
          modifier += "META";

      if( this.getInterestingKeys().indexOf("<" + e.getKeyIdentifier() +
">") > -1 ) {
        var req = org.eclipse.swt.Request.getInstance();
        var widgetManager = org.eclipse.swt.WidgetManager.getInstance();
        var id = widgetManager.findIdByWidget( this );
        req.addParameter( id + ".keyPressed", e.getKeyIdentifier());
        req.addParameter( id + ".keyModifier", modifier);
        e.preventDefault();
        req.send();
      }
    },

    setInteresting : function() {
      //this.debug("setInterestingKeys: " + this.getInterestingKeys());
    }
  }
} ); 
--

---------------------------------------
Björn Fischer, M.Sc.
mail: [email protected] 
fon: +49(0)234-94375-0
fax: +49(0)234-452206
web: http://www.t-p.com/

Triestram & Partner GmbH
Kohlenstrasse 55
44795 Bochum
Deutschland

Geschäftsführer: Reinhard Schymik
Beirat: Anselm Triestram
AG Bochum HRB 3090
USt.-Id. DE127082063
---------------------------------------
Wichtiger Hinweis: Diese E-Mail kann Betriebs- oder Geschäftsgeheimnisse oder 
sonstige vertrauliche Informationen enthalten. Sollten Sie diese E-Mail 
irrtümlich erhalten haben, ist Ihnen eine Kenntnisnahme des Inhalts, eine 
Vervielfältigung oder Weitergabe der E-Mail ausdrücklich untersagt. Bitte 
benachrichtigen Sie uns und vernichten Sie die empfangene E-Mail. Vielen Dank!

Important Note: This e-mail may contain trade secrets or privileged, 
undisclosed or otherwise confidential information. If you have received this 
e-mail in error, you are hereby notified that any review, copying or 
distribution of it is strictly prohibited. Please inform us immediately and 
destroy the original transmittal. Thank you for your cooperation. 
---------------------------------------

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to