Bug 713498 - [b2g] Allow keyCode and charCode to be different in the mozKeyboard interface r=vingtetun

This commit is contained in:
Tim Guan-tin Chien 2011-12-26 15:10:24 +01:00
parent b838f3bf11
commit dc37b5e18b

View File

@ -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);
});
}
};