Allow keyCode and charCode to be different in the temporary mozKeyboard interface

RESOLVED FIXED in mozilla12

Status

()

Core
General
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: timdream, Assigned: timdream)

Tracking

Trunk
mozilla12
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [inbound])

Attachments

(1 attachment)

Created attachment 584307 [details] [diff] [review]
patch v.0

Ref: https://github.com/andreasgal/gaia/issues/195

This bug prevents the touch keyboard to function properly - people are unable to test network functionality because they cannot type the "." symbol.

This patch fixes the mozKeyboard interface before the introduction of key events in bug 711486.
Attachment #584307 - Flags: review?(fabrice)
Comment on attachment 584307 [details] [diff] [review]
patch v.0

>diff -r 9f29daaecbcc b2g/chrome/content/shell.js
> MozKeyboard.prototype = {
>-  sendKey: function mozKeyboardSendKey(keyCode) {
>+  sendKey: function mozKeyboardSendKey(keyCode, charCode) {
>     var utils = window.QueryInterface(Ci.nsIInterfaceRequestor)
>                       .getInterface(Ci.nsIDOMWindowUtils);
>+    if (charCode === undefined) charCode = keyCode;
>     ['keydown', 'keypress', 'keyup'].forEach(function sendKeyEvents(type) {
>-      utils.sendKeyEvent(type, keyCode, keyCode, null);
>+      utils.sendKeyEvent(type, keyCode, charCode, null);

Just do utils.sendKeyEvent(type, keyCode, charCode || keyCode, null);

I will do it while merging.
Attachment #584307 - Flags: review?(fabrice) → review+
http://hg.mozilla.org/integration/mozilla-inbound/rev/507252be27e8
Whiteboard: [inbound]
Target Milestone: --- → mozilla12

Comment 3

5 years ago
https://hg.mozilla.org/mozilla-central/rev/507252be27e8
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.