Bug 713498 - [b2g] Allow keyCode and charCode to be different in the mozKeyboard interface r=vingtetun
authorTim Guan-tin Chien <tchien@mozilla.com>
Mon, 26 Dec 2011 15:10:24 +0100
changeset 83363 507252be27e8ef7b5402d56d62362fefcfe3f889
parent 83362 f8c20866035f5694373f00009764b167b7a53a02
child 83364 10593a36b58dfb1c9083ca8fcc2f98174f92f9df
push id21754
push userbmo@edmorley.co.uk
push dateTue, 27 Dec 2011 01:57:49 +0000
treeherdermozilla-central@838515a06d27 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvingtetun
bugs713498
milestone12.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 713498 - [b2g] Allow keyCode and charCode to be different in the mozKeyboard interface r=vingtetun
b2g/chrome/content/shell.js
--- a/b2g/chrome/content/shell.js
+++ b/b2g/chrome/content/shell.js
@@ -307,17 +307,19 @@ var shell = {
   });
 })();
 
 
 function MozKeyboard() {
 }
 
 MozKeyboard.prototype = {
-  sendKey: function mozKeyboardSendKey(keyCode) {
+  sendKey: function mozKeyboardSendKey(keyCode, charCode) {
+    charCode = (charCode == undefined) ? keyCode : charCode;
+
     var utils = window.QueryInterface(Ci.nsIInterfaceRequestor)
                       .getInterface(Ci.nsIDOMWindowUtils);
     ['keydown', 'keypress', 'keyup'].forEach(function sendKeyEvents(type) {
-      utils.sendKeyEvent(type, keyCode, keyCode, null);
+      utils.sendKeyEvent(type, keyCode, charCode, null);
     });
   }
 };