Author: anevilyak Date: Sat Jul 31 19:12:48 2010 New Revision: 541 URL: http://mmlr.dyndns.org/changeset/541 Log: Apply patch by Matt Madia: Add the escape key as a shortcut to stop page loads. Closes ticket #6409. Modified: webkit/trunk/WebKit/haiku/WebPositive/BrowserWindow.cpp Modified: webkit/trunk/WebKit/haiku/WebPositive/BrowserWindow.cpp ============================================================================== --- webkit/trunk/WebKit/haiku/WebPositive/BrowserWindow.cpp Sat Jul 31 19:11:01 2010 (r540) +++ webkit/trunk/WebKit/haiku/WebPositive/BrowserWindow.cpp Sat Jul 31 19:12:48 2010 (r541) @@ -544,6 +544,9 @@ } else if (bytes[0] == B_RIGHT_ARROW && modifiers == B_COMMAND_KEY) { PostMessage(GO_FORWARD); return; + } else if (bytes[0] == B_ESCAPE) { + PostMessage(STOP); + return; } else if (bytes[0] == B_FUNCTION_KEY) { // Some function key Firefox compatibility int32 key; @@ -2084,27 +2087,27 @@ // TODO: What if it isn't HTML, but for example SVG? BString source; ret = message->FindString("source", &source); - + if (ret == B_OK) ret = find_directory(B_COMMON_TEMP_DIRECTORY, &pathToPageSource); - + BString tmpFileName("PageSource_"); tmpFileName << system_time() << ".html"; if (ret == B_OK) ret = pathToPageSource.Append(tmpFileName.String()); - + BFile pageSourceFile(pathToPageSource.Path(), B_CREATE_FILE | B_ERASE_FILE | B_WRITE_ONLY); if (ret == B_OK) ret = pageSourceFile.InitCheck(); - + if (ret == B_OK) { ssize_t written = pageSourceFile.Write(source.String(), source.Length()); if (written != source.Length()) ret = (status_t)written; } - + if (ret == B_OK) { const char* type = "text/html"; size_t size = strlen(type);