Skip to content

Commit

Permalink
SimonStewart: Applying patch from David Wang to enable the delete key.
Browse files Browse the repository at this point in the history
r5313
  • Loading branch information
shs96c committed Jun 30, 2008
1 parent 4b2de36 commit 1d94634
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CREDITS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ Mirko Nasato
Marc Guillemot
Alexis Vuillemin
Noel Gordon
David Wang

1 change: 1 addition & 0 deletions common/src/java/org/openqa/selenium/Keys.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public enum Keys implements CharSequence {
ARROW_RIGHT('\uE003'),
ARROW_DOWN('\uE004'),
BACK_SPACE('\uE005'),
DELETE('\uE006'),
;

private Keys(char keyCode) {
Expand Down
20 changes: 20 additions & 0 deletions common/src/java/org/openqa/selenium/WebDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,26 @@ public interface WebDriver {
*/
void quit();

/**
* Execute javascript in the context of the currently selected frame or window.
* This means that "document" will refer to the current document. If the script
* has a return value, then the following steps will be taken:
*
* <ul>
* <li>For an HTML element, this method returns a WebElement</li>
* <li>For a number, a Long is returned</li>
* <li>For a boolean, a Boolean is returned</li>
* <li>For all other cases, a String is returned.</li>
* <li>For an array, we check the first element, and attempt to return a List of
* that type, following the rules above. We do not support nested lists.</li>
* <li>Unless the value is null or there is no return value</li>
* </ul>
*
* @param script
* @return One of Boolean, Long, String, List or WebElement. Or null.
*/
// Object executeScript(String script);

/**
* Send future commands to a different frame or window.
*
Expand Down
6 changes: 6 additions & 0 deletions firefox/src/extension/components/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ Utils.type = function(context, element, text) {
} else if (c == '\uE003') {
keyCode = Components.interfaces.nsIDOMKeyEvent.DOM_VK_RIGHT;
character = keyCode;
} else if (c == '\uE005') {
keyCode = Components.interfaces.nsIDOMKeyEvent.DOM_VK_BACK_SPACE;
character = keyCode;
} else if (c == '\uE006') {
keyCode = Components.interfaces.nsIDOMKeyEvent.DOM_VK_DELETE;
character = keyCode;
} else if (c == "\n") {
keyCode = Components.interfaces.nsIDOMKeyEvent.DOM_VK_RETURN;
character = keyCode;
Expand Down
5 changes: 5 additions & 0 deletions jobbie/src/cpp/InternetExplorerDriver/ElementWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,11 @@ void ElementWrapper::sendKeys(const std::wstring& newValue)
scanCode = keyCode;
c = keyCode;
extended = true;
} else if (k == 0xE006) {
keyCode = VK_DELETE;
scanCode = keyCode;
c = keyCode;
extended = true;
} else if (c == L'\n') {
keyCode = VK_RETURN;
scanCode = keyCode;
Expand Down

0 comments on commit 1d94634

Please sign in to comment.