Last Comment Bug 669361 - ASUS Transformer and Slider hardware keyboard is always en-US (pre-Jelly Bean)
: ASUS Transformer and Slider hardware keyboard is always en-US (pre-Jelly Bean)
Status: VERIFIED FIXED
HKB
: mobile, relnote
Product: Firefox for Android
Classification: Client Software
Component: Keyboards and IME (show other bugs)
: Trunk
: ARM Android
: P2 normal with 9 votes (vote)
: Firefox 18
Assigned To: Chris Peterson [:cpeterson]
:
: Jim Chen [:jchen] [:darchons]
Mentors:
: 676773 792736 (view as bug list)
Depends on: 795224
Blocks: 712018 795431
  Show dependency treegraph
 
Reported: 2011-07-05 10:27 PDT by Mike Hommey [:glandium]
Modified: 2016-07-29 14:19 PDT (History)
30 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
-
-
wontfix
+
verified
+
verified


Attachments
asus-transformer-hkb.patch (5.08 KB, patch)
2012-09-11 14:08 PDT, Chris Peterson [:cpeterson]
blassey.bugs: review+
lukasblakk+bugs: approval‑mozilla‑aurora+
Details | Diff | Splinter Review

Description Mike Hommey [:glandium] 2011-07-05 10:27:08 PDT
When using the asus transformer hardware keyboard, whichever keyboard layout is configured (using the one corresponding to the system language when the language is not en-us, using a specific selection), the keys that fennec gets are always that of an en-us keyboard.

It however gets proper keys from the soft keyboard.
Comment 1 Aaron Train [:aaronmt] 2011-07-06 12:51:16 PDT
SUMO User Report -> https://support.mozilla.com/en-US/questions/844343
Comment 2 Aaron Train [:aaronmt] 2011-07-11 07:48:02 PDT
Not just the Transformer, report of LG LU2300 -> https://support.mozilla.com/en-US/questions/848586#answers
Comment 3 Violhaine Grimly 2011-08-04 06:27:34 PDT
On the Transformer (french AZERTY dock keyboard, Android 3.2), the delete key eats at least two chars each time under FF Mobile Beta (did not test the stable release).
Comment 4 Mike Hommey [:glandium] 2011-08-04 06:30:26 PDT
(In reply to comment #3)
> On the Transformer (french AZERTY dock keyboard, Android 3.2), the delete
> key eats at least two chars each time under FF Mobile Beta (did not test the
> stable release).

This is bug 662219
Comment 5 Kevin Brosnan [:kbrosnan] 2011-08-06 18:57:18 PDT
*** Bug 676773 has been marked as a duplicate of this bug. ***
Comment 6 Thomas Arend [:tarend] 2011-08-14 17:02:50 PDT
Issues have also been reported with the Bluetooth keyboard and the Galaxy Tab - that keyboard also seems to be stuck in en-US only.
Comment 7 Alex Pakhotin (:alexp) 2011-09-07 12:37:25 PDT
Tried Galaxy Tab 10.1 with a Bluetooth keyboard, and it seems to be working as it should - I could enter Russian text with it. I had to switch the language on the software keyboard ("Samsung keypad") though. Not sure if there are other ways to switch it in such configuration.

Apparently there is something specific to the Transformer.
Comment 8 Mike Hommey [:glandium] 2011-09-08 07:22:15 PDT
You know what ? It actually looks like it's fixed. I hadn't noticed because I haven't been using the hardware keyboard with fennec lately, but it does work now. I double checked that the Firefox 6 install I have does have the problem and it does, which suggests this is not something that was solved by the upgrade to honeycomb 3.2.
Comment 9 Francesco Lodolo [:flod] 2011-09-10 05:37:06 PDT
I was searching bugzilla because I was having the same problem, then I discovered that switching from Asus Keyboard (language) to Android Keybooard and then back to Asus Keyboard solves the problem (at least for me on Asus Transformer).
Comment 10 Patrick 2011-09-14 16:07:06 PDT
I just received an ASUS Transformer, updated it to 3.2 and then installed Firefox 6.0.2.

And this bug is bugging on! Soft Keyboard works. Switching back and forth has no effect on  the bug though.

Problems:

      - backspace key rubs out 2 characters
      - ALL keys are behaving as if the keyboard was in en_US mode (including the famous y and z switched)
      - pg-up / pg-dwn is not working (i have had this issue this with the desktop version of firefox on my pc where it has "magically" disappeared - maybe the same kind of magic hommey described... ?) 

The system default language is en_US and the keyboard has a de_CH layout. All other applications are working correctly but firefox.
Comment 11 mail 2011-09-15 10:20:22 PDT
Works for me in Nightly (nightly.mozilla.org) with Android 3.2. Can those of you who have this problem try nightly?

I also have the dock update that was released a while ago. I don't remember when it was released, and I don't know if the dock update is relevant to this problem.
Comment 12 Markus Golser 2011-09-15 23:15:21 PDT
works for me using the nightly build.
Comment 13 matejcik 2012-06-26 07:40:12 PDT
please reopen, this is still a problem a year later with Firefox stable from Google Play
Comment 14 matejcik 2012-06-26 07:41:48 PDT
my system is Asus Transformer TF101 with ICS 4.0.3
(incidentally, even though it's listed as one of the supported devices, it is apparently disallowed in Google Play, i'll open a new bug about that)
Comment 15 Aaron Train [:aaronmt] 2012-06-26 07:45:33 PDT
Please re-test on Nightly (http://nightly.mozilla.org). Currently our newly released product does not support tablets. Expect an update in the following weeks.
Comment 16 matejcik 2012-06-26 07:53:32 PDT
Yes, Nightly has the same problem.
also it crashed when i tried the workaround from comment 9
Comment 17 Mauvaisours 2012-06-29 13:07:12 PDT
Tested nightly on TF201 with french keyboard. Problem still exists. Note: adress bar works OK, only textboxes exhibit incorrect behaviour.
Comment 18 Antoine Turmel [:GeekShadow] 2012-06-30 07:04:13 PDT
Still have the issue on TF101 with french keyboard too.
Comment 19 hobbes 2012-07-01 03:00:58 PDT
no problem anymore for me with Belgian keyboard on TF101 running CM9 nightly (ICS 4.0.4) and Firefox nighthly. Keyboard is fr_be in address bar and in web pages, and backspace deletes only one char.
Comment 20 Antoine Turmel [:GeekShadow] 2012-07-01 08:30:34 PDT
(In reply to hobbes from comment #19)
> no problem anymore for me with Belgian keyboard on TF101 running CM9 nightly
> (ICS 4.0.4) and Firefox nighthly. Keyboard is fr_be in address bar and in
> web pages, and backspace deletes only one char.

Because I think the issue is on the original Asus rom and keyboard settings
Comment 21 flyaaway 2012-07-15 14:38:30 PDT
same problem with nighthly and toshiba ac100 (have physical keyboard)
Comment 22 timo 2012-08-23 23:19:14 PDT
I have the same issue with Asus TF-300T dock. Keybooard layout is correct in the address bar, but always US in HTML-form. I'm using latest version of Firefox from Google Play (15.0).
Comment 23 yvesago 2012-08-30 14:01:38 PDT
always same issue with firefox beta 16 on assus slider SL101
Comment 24 Chris Peterson [:cpeterson] 2012-08-30 17:59:42 PDT
The problem is that we are dispatching JS key events based on the Android hardware key *codes* (where a QWERTZ keyboard's Z key still returns KEYCODE_Y), instead of honoring the actual changed text.
Comment 25 timo 2012-08-31 11:31:21 PDT
Jelly Bean upgrade on Asus TF-300T seems to fix the problem.
Comment 26 yldevice 2012-09-03 07:36:22 PDT
The same problem with Asus eee Slider. Note: in some versions of FF/FF beta/Aurora ctrl+space did work for changing the language, but mostly in an "unstable" fashion: "now it works, after opening another tab it doesn't" or "previous time I opened FF beta, it worked, now it doesn't" etc. Currently, I'm not able to change the language in each FF 15, FF beta 16 and Aurora 17. This really prevents me from using FF.
Comment 27 yldevice 2012-09-03 07:52:35 PDT
And the thing timo@tolleri.net mentioned for Transformer (in address bar the language changes) is true for Slider, for each FF, FF beta and Aurora.
Comment 28 Lukas Blakk [:lsblakk] use ?needinfo 2012-09-07 14:59:06 PDT
This is not serious enough to chemspill for (again) but let's see if we can get a fix ready to uplift to branches in the next week or so (by Beta 4).
Comment 29 Chris Peterson [:cpeterson] 2012-09-11 14:08:28 PDT
Created attachment 660217 [details] [diff] [review]
asus-transformer-hkb.patch

Ignore non-en_US HKB KeyEvents for Asus Transformer tablets running Honeycomb or ICS.

Asus Transformer tablets generate en-US keycodes for HKB keys, regardless of system locale or keyboard layout. This bug is reportedly fixed in Jelly Bean.

I don't really like the method name `hasBuggyHardwareKeyboardLayout()`. If you have any suggestions, please let me know! :)
Comment 30 Makoto Kato [:m_kato] 2012-09-11 22:12:02 PDT
What IME does Transform use on non-US version?  If Transformer uses special IME (not Android Keyboard), we should use Secure.Settings.DEFAULT_INPUT_METHOD to check keyboard/IME.  Your suggestion code doesn't work other en-US IME using prediction (Actually, it doesn't still work on the latest Fennec, also). 

Also, if onKeyPreIme returns false instead of, I think this can fix this easily.  IME handles key input, so then, it sends correct character via IME method.
Comment 31 Chris Peterson [:cpeterson] 2012-09-12 10:25:05 PDT
(In reply to Makoto Kato from comment #30)
> What IME does Transform use on non-US version?  If Transformer uses special
> IME (not Android Keyboard), we should use
> Secure.Settings.DEFAULT_INPUT_METHOD to check keyboard/IME.

The Transformer's DEFAULT_INPUT_METHOD does not return a different value when a hardware keyboard is connected. The only way we know if a key event is from the hardware keyboard is when onKeyPreIme called.

My patch will return false from onKeyPreIme because onKeyPreIme calls the processKeyDown/processKeyUp methods I changed.

Android calls onTextChanged() with the correct string value. The problem is that onKeyPreIme() is called with an untranslated, en-US keycode. So a QWERTZ keyboard layout will produce a KEYCODE_Y when it should (AFAIK) produce KEYCODE_Z.


> Your suggestion
> code doesn't work other en-US IME using prediction (Actually, it doesn't
> still work on the latest Fennec, also). 

Can you please clarify what you mean by "other en-US IME using prediction"? This bug only affects the Transformer's hardware keyboard.
Comment 32 Maxim Levitsky 2012-09-18 01:28:04 PDT
Still a problem on galaxy tab 10.1 :-(

I use firefox beta.
Note that original firefox didnt have this issue (at least till the latest update which I didnt install on purpose to not have this bug)

Yet I love to switch to latest firefox as it is much better.
Comment 33 Chris Peterson [:cpeterson] 2012-09-18 11:25:24 PDT
hi Maxim, this bug is specifically about the Asus Transformer's hardware keyboard with non-en-US layouts. If you open a new bug report describing the steps to reproduce your Galaxy Tab problem, we can investigate.
Comment 34 Scoobidiver (away) 2012-09-18 11:50:17 PDT
(In reply to Chris Peterson (:cpeterson) from comment #33)
> hi Maxim, this bug is specifically about the Asus Transformer's hardware
> keyboard with non-en-US layouts. 
ASUS Slider is impacted.
Comment 35 Chris Peterson [:cpeterson] 2012-09-18 18:26:02 PDT
Comment on attachment 660217 [details] [diff] [review]
asus-transformer-hkb.patch

Makoto is busy, so I am changing r=? to blassey.
Comment 36 Brad Lassey [:blassey] (use needinfo?) 2012-09-18 19:05:01 PDT
Chris, can you explain what is going on here? Why do these early returns fix the issue and why only when the default locale is en-US?
Comment 37 Makoto Kato [:m_kato] 2012-09-18 21:49:22 PDT
(In reply to Chris Peterson (:cpeterson) from comment #31)
> (In reply to Makoto Kato from comment #30)
> > What IME does Transform use on non-US version?  If Transformer uses special
> > IME (not Android Keyboard), we should use
> > Secure.Settings.DEFAULT_INPUT_METHOD to check keyboard/IME.
> 
> The Transformer's DEFAULT_INPUT_METHOD does not return a different value
> when a hardware keyboard is connected. The only way we know if a key event
> is from the hardware keyboard is when onKeyPreIme called.
> My patch will return false from onKeyPreIme because onKeyPreIme calls the
> processKeyDown/processKeyUp methods I changed.

onKeyPreIme should handle KEYCODE_MENU/KEY_CODE_BACK/KEYCODE_VOLUME_UP/KEYCODE_VOLUME_DOWN.  Current fix eats these keys by IME since all key returns false.

See xul version code of GekcoInputConnection.java.

> Android calls onTextChanged() with the correct string value. The problem is
> that onKeyPreIme() is called with an untranslated, en-US keycode. So a
> QWERTZ keyboard layout will produce a KEYCODE_Y when it should (AFAIK)
> produce KEYCODE_Z.

Yes.  correct.

> > Your suggestion
> > code doesn't work other en-US IME using prediction (Actually, it doesn't
> > still work on the latest Fennec, also). 
> 
> Can you please clarify what you mean by "other en-US IME using prediction"?
> This bug only affects the Transformer's hardware keyboard.

This issue is for all Android hardware keyboard input, not Transformer only.

If there is hardware keyboard w/ IME supports prediction like swiftkey on software keyboard, prediction input by IME doesn't work since onKeyPreIme returns true on NativeFennec.  As long as I know, this is no IME for this now .  So please ignore this.
Comment 38 Maxim Levitsky 2012-09-19 06:22:52 PDT
@Chris Peterson @Makoto Kato

> This issue is for all Android hardware keyboard input, not Transformer only.

This is why I commented on this bugreport and didn't open a new one.
Comment 39 Chris Peterson [:cpeterson] 2012-09-19 10:32:50 PDT
(In reply to Makoto Kato from comment #37)
> onKeyPreIme should handle
> KEYCODE_MENU/KEY_CODE_BACK/KEYCODE_VOLUME_UP/KEYCODE_VOLUME_DOWN.  Current
> fix eats these keys by IME since all key returns false.
> 
> See xul version code of GekcoInputConnection.java.

Thanks. I'll look at the XUL version.


> > Can you please clarify what you mean by "other en-US IME using prediction"?
> > This bug only affects the Transformer's hardware keyboard.
> 
> This issue is for all Android hardware keyboard input, not Transformer only.

Makoto, does this mean my patch should be generic for all hardware keyboard input instead of hardcoding a check for "asus EeePad"? I have not seen any QWERTZ/Y problems with non-Asus devices with slider keyboards. And the Jelly Bean update for the Asus Transformer reportedly fixes this bug (though I can't test this because my Transformer has ICS).
Comment 40 Chris Peterson [:cpeterson] 2012-09-19 10:39:01 PDT
(In reply to Brad Lassey [:blassey] from comment #36)
> Chris, can you explain what is going on here? Why do these early returns fix
> the issue and why only when the default locale is en-US?

Brad, the Asus Transformer tablets generate en-US keycodes for HKB keys, regardless of system locale or keyboard layout. This bug is reportedly fixed in Jelly Bean.

The problem is that Android calls our onKeyPreIme() with an untranslated, en-US keycode. So a QWERTZ keyboard layout will produce a KEYCODE_Y when it should (AFAIK) produce KEYCODE_Z. Returning false from onKeyPreIme() will prevent us from processing the unwanted KEYCODE_Y event, so Android will call our onTextChanged() with the correct string value ('z').

I don't like the method name `hasBuggyHardwareKeyboardLayout()`. If you have any suggestions, please let me know.
Comment 41 Chris Peterson [:cpeterson] 2012-09-20 10:32:51 PDT
*** Bug 792736 has been marked as a duplicate of this bug. ***
Comment 42 Chris Peterson [:cpeterson] 2012-09-25 12:07:11 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/90dd2e82f891
Comment 43 Chris Peterson [:cpeterson] 2012-09-25 12:08:20 PDT
If Asus Transformer users are happy with this fix on Nightly 18, I will ask to uplift this fix to Aurora 17.
Comment 44 Mounir Lamouri (:mounir) 2012-09-26 04:08:57 PDT
https://hg.mozilla.org/mozilla-central/rev/90dd2e82f891
Comment 45 roumensois@gmail.com 2012-09-26 07:36:56 PDT
Doesn't work for me on ASUS Transformer TF700... Still QWERTY with the deck.
Comment 46 Scoobidiver (away) 2012-09-26 08:33:41 PDT
(In reply to roumensois@gmail.com from comment #45)
> Doesn't work for me on ASUS Transformer TF700... Still QWERTY with the deck.
Nightly are built each night, not after each patch land. So wait tomorrow before reporting a failure.
Comment 47 Aaron Train [:aaronmt] 2012-09-27 13:01:34 PDT
(In reply to roumensois@gmail.com from comment #45)
> Doesn't work for me on ASUS Transformer TF700... Still QWERTY with the deck.

How about today's Nightly build (09/27) (http://nightly.mozilla.org).
Comment 48 yvesago 2012-09-27 13:06:28 PDT
Nightly is better thanks
but there's no more backspace and arrows :/
Comment 49 roumensois@gmail.com 2012-09-27 23:25:42 PDT
(In reply to Aaron Train [:aaronmt] from comment #47)
Keyboard is now correctly recognized, but, same as yvesago, no more backspaces nor arrows.
Comment 50 Makoto Kato [:m_kato] 2012-09-27 23:32:22 PDT
(In reply to roumensois@gmail.com from comment #49)
> (In reply to Aaron Train [:aaronmt] from comment #47)
> Keyboard is now correctly recognized, but, same as yvesago, no more
> backspaces nor arrows.

could you file a new bug?   I think that onKeyDown should be ignore hasBuggyHardwareKeyboardLayout().  (although I comment this by commnet #37, chris doesn't care this yet.)
Comment 51 roumensois@gmail.com 2012-09-28 03:22:04 PDT
(In reply to Makoto Kato from comment #50)
> (In reply to roumensois@gmail.com from comment #49)
> > (In reply to Aaron Train [:aaronmt] from comment #47)
> > Keyboard is now correctly recognized, but, same as yvesago, no more
> > backspaces nor arrows.
> 
> could you file a new bug?   I think that onKeyDown should be ignore
> hasBuggyHardwareKeyboardLayout().  (although I comment this by commnet #37,
> chris doesn't care this yet.)

Done: Bug 795224
Comment 52 matejcik 2012-10-02 09:03:14 PDT
...did you just resolve the dependent bug by reverting the fix to this one?
Comment 53 Chris Peterson [:cpeterson] 2012-10-02 10:36:44 PDT
matejcik, Makoto fixed dependent bug 795224 without reverting this bug's fix. Did you find an Asus keyboard regression?
Comment 54 matejcik 2012-10-03 07:58:29 PDT
no, i got that impression from reading the patches. apparently i misread.
the current Nightly is working perfectly.
Comment 55 Chris Peterson [:cpeterson] 2012-10-03 17:03:20 PDT
We don't need to track this bug for 16 or 17. It would be nice to fix in 17, but it is not a regression (and is fixed in 18).
Comment 56 Alex Keybl [:akeybl] 2012-10-05 09:30:27 PDT
(In reply to Chris Peterson (:cpeterson) from comment #55)
> We don't need to track this bug for 16 or 17. It would be nice to fix in 17,
> but it is not a regression (and is fixed in 18).

Too risky to fix for FF17?
Comment 57 Chris Peterson [:cpeterson] 2012-10-05 10:27:26 PDT
(In reply to Alex Keybl [:akeybl] from comment #56)
> (In reply to Chris Peterson (:cpeterson) from comment #55)
> > We don't need to track this bug for 16 or 17. It would be nice to fix in 17,
> > but it is not a regression (and is fixed in 18).
> 
> Too risky to fix for FF17?

No. The fix should be pretty safe because it changes for device type and OS version so it only affects a subset of Asus devices running Honeycomb or ICS.

If I uplift this fix to FF17, I will need to remember to uplift bug 795224 too (because it fixed a regression in this bug's patch).
Comment 58 Chris Peterson [:cpeterson] 2012-10-05 10:35:34 PDT
^ s/changes the device type/checks the device type/
Comment 59 Chris Peterson [:cpeterson] 2012-10-05 10:37:09 PDT
Comment on attachment 660217 [details] [diff] [review]
asus-transformer-hkb.patch

[Approval Request Comment]
Bug caused by (feature/regressing bug #): Android OS bug
User impact if declined: Asus Transformers' hardware keyboards will always have en-US key layouts, regardless of user locale.
Testing completed (on m-c, etc.): m-c
Risk to taking this patch (and alternatives if risky): The fix should be pretty safe because it checks for device type and OS version so it only affects a subset of Asus devices running Honeycomb or ICS. Asus devices running Jelly Bean don't need this workaround.
String or UUID changes made by this patch: N/A

Also, this patch had a regression that was fix by bug 795224, so that bug's patch will also need a+ to be uplifted.
Comment 60 Lukas Blakk [:lsblakk] use ?needinfo 2012-10-05 15:11:00 PDT
Comment on attachment 660217 [details] [diff] [review]
asus-transformer-hkb.patch

approved the patch in bug 795224 to go along with this, please land before merge day oct 8th.
Comment 61 Chris Peterson [:cpeterson] 2012-10-05 15:49:36 PDT
https://hg.mozilla.org/releases/mozilla-aurora/rev/4411e891e61f

Note You need to log in before you can comment on or make changes to this bug.