fireunit icon indicating copy to clipboard operation
fireunit copied to clipboard

Feature Request: keyup event simulator

Open jfgomez86 opened this issue 16 years ago • 0 comments

I just noticed you simulate a 'keypress' event, which doesn't actually mean a 'keyup' event will be triggered when running the fireunit.key helper. It would be nice if you could add a 'keyup' event helper. I'm no javascript ninja, but this worked for me:

  // Extend fireunit to make it simulate a keyUp event
  fireunit.keyup = function ( node ){
    node = this.id( node );

    var doc = node.ownerDocument, event = doc.createEvent("KeyEvents");
    event.initKeyEvent("keyup", true, true, doc.defaultView, false, false, false,
    false, false, false);
    return node.dispatchEvent( event );
  }

jfgomez86 avatar Jul 06 '09 05:07 jfgomez86