Hello Sebastian,

the thing is that even the line "list.debug (vKeyCode); " is never reached when I press the "up" or "down" key. The keypress event does not seem to fire in this case. I can build a test case, but wanted to know before if that might be intended behavior for some reason (making a test case unneccessary).

Otherwise, as you know,

QxKeyEvent.keys =
{
   [ ...]
 up : 38,
 down : 40,
[...] }

Thanks,

Christian

Sebastian Werner schrieb:
Hi,

what's about to debug the keycode and tell us this code?

Sebastian


Christian Boulanger schrieb:
I have the following code receiving a keypress event from a QxTextField

bg_autocomplete.checkKey = function ( e )
{
   var vTarget      = e.getTarget();
   var vKeyCode     = e.getKeyCode();
   var list         = bg_autocomplete;
   var manager     = list.getManager();
   var isVisible    = list.getVisibility();
      list.debug (vKeyCode);
      // enter
   if ( vKeyCode == QxKeyEvent.keys.enter ) {
       if ( isVisible ) {
           list.complete ( vTarget, list.getSelectedItem().getValue() );
           list.hide();
       }
   }
      // escape
   if ( vKeyCode == QxKeyEvent.keys.esc ) {
       if ( isVisible ) {
           list.hide();
       } else {
           // todo: return to previous content
       }
   }
      // down
   if ( vKeyCode == QxKeyEvent.keys.down ) {
       if ( isVisible ) {
       list.debug ( "down!" );
manager.setSelectedItem( manager.getSelectedItem().getNextSibling() );
           list.complete ( vTarget, list.getSelectedItem().getValue() );
       }
   }
      // up
   if ( vKeyCode == QxKeyEvent.keys.up ) {
       if ( isVisible ) {
           list.debug ( "up!" );
manager.setSelectedItem( manager.getSelectedItem().getPreviousSibling() ); list.complete ( textField, list.getSelectedItem().getValue() );
       }
   }
      return false;
}

While enter and escape are properly responded to, the QxKeyEvent.keys.down and QxKeyEvent.keys.up keys are never received by the event listener. Is this an intended behaviour?

Thanks,

Christian



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to