Skip to content

Commit

Permalink
Fix keyCodes for some characters in the FirefoxDriver.
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Juang <[email protected]>
  • Loading branch information
DrMarcII authored and juangj committed Jan 25, 2016
1 parent 7a02585 commit 83984c0
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions javascript/firefox-driver/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,36 @@ Utils.type = function(doc, element, text, jsTimer, releaseModifiers,
} else if (c == '\'' || c == '"') {
keyCode = Components.interfaces.nsIDOMKeyEvent.DOM_VK_QUOTE;
charCode = c.charCodeAt(0);
} else if (c == '^') {
keyCode = Components.interfaces.nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX;
charCode = c.charCodeAt(0);
} else if (c == '!') {
keyCode = Components.interfaces.nsIDOMKeyEvent.DOM_VK_EXCLAMATION;
charCode = c.charCodeAt(0);
} else if (c == '#') {
keyCode = Components.interfaces.nsIDOMKeyEvent.DOM_VK_HASH;
charCode = c.charCodeAt(0);
} else if (c == '$') {
keyCode = Components.interfaces.nsIDOMKeyEvent.DOM_VK_DOLLAR;
charCode = c.charCodeAt(0);
} else if (c == '%') {
keyCode = Components.interfaces.nsIDOMKeyEvent.DOM_VK_PERCENT;
charCode = c.charCodeAt(0);
} else if (c == '&') {
keyCode = Components.interfaces.nsIDOMKeyEvent.DOM_VK_AMPERSAND;
charCode = c.charCodeAt(0);
} else if (c == '_') {
keyCode = Components.interfaces.nsIDOMKeyEvent.DOM_VK_UNDERSCORE;
charCode = c.charCodeAt(0);
} else if (c == '-') {
keyCode = Components.interfaces.nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS;
charCode = c.charCodeAt(0);
} else if (c == '(') {
keyCode = Components.interfaces.nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET;
charCode = c.charCodeAt(0);
} else if (c == ')') {
keyCode = Components.interfaces.nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET;
charCode = c.charCodeAt(0);
} else {
keyCode = upper.charCodeAt(i);
charCode = text.charCodeAt(i);
Expand Down

0 comments on commit 83984c0

Please sign in to comment.