B2G/gecko/testing/peptest/peptest/extension/resource/mozmill/stdlib/EventUtils.js
/**
 * Send the char aChar to the node with id aTarget.  If aTarget is not
 * provided, use "target".  This method handles casing of chars (sends the
 * right charcode, and sends a shift key for uppercase chars).  No other
 * modifiers are handled at this point.
 *
 * For now this method only works for English letters (lower and upper case)
 * and the digits 0-9.
 *
 * Returns true if the keypress event was accepted (no calls to preventDefault
 * or anything like that), false otherwise.
 */
Send the char aChar to the node with id aTarget.  If aTarget is not
provided, use "target".  This method handles casing of chars (sends the
right charcode, and sends a shift key for uppercase chars).  No other
modifiers are handled at this point.

For now this method only works for English letters (lower and upper case)
and the digits 0-9.

Returns true if the keypress event was accepted (no calls to preventDefault
or anything like that), false otherwise.
Send the char aChar to the node with id aTarget . If aTarget is not provided use " target " . This method handles casing of chars ( sends the right charcode and sends a shift key for uppercase chars ) . No other modifiers are handled at this point . For now this method only works for English letters ( lower and upper case ) and the digits 0 - 9 . Returns true if the keypress event was accepted ( no calls to preventDefault or anything like that ) false otherwise .
function sendChar(aChar, aTarget) {
  var hasShift = (aChar == aChar.toUpperCase());
  var charCode = aChar.charCodeAt(0);
  var keyCode = charCode;
  if (!hasShift) {
    keyCode -= 0x20;
  }
  return __doEventDispatch(aTarget, charCode, keyCode, hasShift);
}
function sendChar ( aChar , aTarget ) { var hasShift = ( aChar == aChar . toUpperCase ( ) ) ; var charCode = aChar . charCodeAt ( 0 ) ; var keyCode = charCode ; if ( ! hasShift ) { keyCode -= 0x20 ; } return __doEventDispatch ( aTarget , charCode , keyCode , hasShift ) ; }
Send the char aChar to the node with id aTarget.
Send the char aChar to the node with id aTarget .
// DOM event charcodes match ASCII (JS charcodes) for a-zA-Z0-9. // For lowercase letters, the keyCode is actually 32 less than the charCode