Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 361225
Collapse All | Expand All

(-)js/org/eclipse/rwt/KeyEventUtil.js (-22 / +7 lines)
Lines 1-11 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2009, 2011 EclipseSource and others. All rights reserved.
2
 * Copyright (c) 2009, 2011 EclipseSource and others.
3
 * This program and the accompanying materials are made available under the
3
 * All rights reserved. This program and the accompanying materials
4
 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * and is available at http://www.eclipse.org/legal/epl-v10.html
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 *
7
 *
7
 * Contributors:
8
 * Contributors:
8
 *   EclipseSource - initial API and implementation
9
 *    EclipseSource - initial API and implementation
9
 ******************************************************************************/
10
 ******************************************************************************/
10
11
11
qx.Class.define( "org.eclipse.rwt.KeyEventUtil", {
12
qx.Class.define( "org.eclipse.rwt.KeyEventUtil", {
Lines 93-115 Link Here
93
    },
94
    },
94
    
95
    
95
    _isRelevantEvent : function( eventType, keyCode ) {
96
    _isRelevantEvent : function( eventType, keyCode ) {
96
      var result;
97
      return eventType === "keypress";
97
      if( qx.core.Variant.isSet( "qx.client", "mshtml" ) ) {
98
        // TODO [tb] : is the browser-switch still relevant?
99
        var keyEventHandler = org.eclipse.rwt.EventHandlerUtil;
100
        var nonPrintable  =    keyEventHandler._isNonPrintableKeyCode( keyCode )
101
                            || keyCode == 27 // escape
102
                            || keyCode == 8  // backspace
103
                            || keyCode == 9; // tab
104
        if( nonPrintable ) {
105
          result = eventType === "keydown";
106
        } else {
107
          result = eventType === "keypress";
108
        }
109
      } else {
110
        result = eventType === "keypress";
111
      }
112
      return result;
113
    },
98
    },
114
99
115
    _getTargetControl : function() {
100
    _getTargetControl : function() {
(-)js/org/eclipse/rwt/SyncKeyEventUtil.js (-4 / +4 lines)
Lines 1-13 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2008, 2010 Innoopract Informationssysteme GmbH.
2
 * Copyright (c) 2008, 2011 Innoopract Informationssysteme GmbH and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     Innoopract Informationssysteme GmbH - initial API and implementation
9
 *    Innoopract Informationssysteme GmbH - initial API and implementation
10
 *     EclipseSource - ongoing development
10
 *    EclipseSource - ongoing development
11
 ******************************************************************************/
11
 ******************************************************************************/
12
12
13
qx.Class.define( "org.eclipse.rwt.SyncKeyEventUtil",
13
qx.Class.define( "org.eclipse.rwt.SyncKeyEventUtil",
Lines 22-27 Link Here
22
  
22
  
23
  members : {
23
  members : {
24
    intercept : function( eventType, keyCode, charCode, domEvent ) {
24
    intercept : function( eventType, keyCode, charCode, domEvent ) {
25
      this._cancelEvent = false;
25
      // [if] Fix for bug 319159
26
      // [if] Fix for bug 319159
26
      var keyUtil = org.eclipse.rwt.KeyEventUtil.getInstance();
27
      var keyUtil = org.eclipse.rwt.KeyEventUtil.getInstance();
27
      var realKeyCode = this._getRealKeyCode( keyCode, domEvent );
28
      var realKeyCode = this._getRealKeyCode( keyCode, domEvent );
Lines 37-43 Link Here
37
        if( hasKeyListener || ( hasTraverseListener && isTraverseKey ) ) {
38
        if( hasKeyListener || ( hasTraverseListener && isTraverseKey ) ) {
38
          // [if] Don't keep and modify the pending event object outside the
39
          // [if] Don't keep and modify the pending event object outside the
39
          // "intercept" method. Such approach does not work in IE.
40
          // "intercept" method. Such approach does not work in IE.
40
          this._cancelEvent = false;
41
          this._sendKeyDown( control, realKeyCode, charCode, domEvent );
41
          this._sendKeyDown( control, realKeyCode, charCode, domEvent );
42
          if( this._cancelEvent ) {
42
          if( this._cancelEvent ) {
43
            this._cancelDomEvent( domEvent );
43
            this._cancelDomEvent( domEvent );

Return to bug 361225