Permalink
Browse files

Bug 713498 - [b2g] Allow keyCode and charCode to be different in the …

…mozKeyboard interface r=vingtetun
  • Loading branch information...
1 parent d0a9946 commit 8b38816a11c4e7f649c85e99669d2b5badcc7c3f Tim Guan-tin Chien committed Dec 26, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 b2g/chrome/content/shell.js
@@ -312,11 +312,13 @@ 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);
});
}
};

0 comments on commit 8b38816

Please sign in to comment.