Closed Bug 825752 Opened 9 years ago Closed 11 months ago

Minus key (-) generates 0 keycode instead of 109 on TF300T

Categories

(Firefox for Android Graveyard :: Keyboards and IME, defect)

18 Branch
Other
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: hwguy.siplus, Unassigned, Mentored)

Details

(Whiteboard: [lang=c++])

User Agent: Mozilla/5.0 (Android; Tablet; rv:18.0) Gecko/18.0 Firefox/18.0
Build ID: 20121227073833

Steps to reproduce:

Created a handler of window.onkeydown with alert(e.keyCode) and pressed - on ASUS Transformer TF300T dock keyboard.


Actual results:

I got 0 keycode.


Expected results:

I get 109 keycode.
Android Activity.onKeyDown reports the keyCode being 69.
which is KEYCODE_MINUS
It's okay to return 189 instead of 109 for '-' and 187 instead of 61 for '='. WebKit and Trident do so.

***PATCH***

source/widget/android/nsWindow.cpp
line 1434
Change entire line to:
case AndroidKeyEvent::KEYCODE_MINUS: return NS_VK_SUBTRACT;
NS_VK_HYPHEN_MINUS is probably not a good keycode, because in 2 functions it has ASCII counterpart '-' that has char code of 45, which is entirely different than the two key codes.
Assignee: nobody → nchen
(In reply to SiPlus from comment #3)
> It's okay to return 189 instead of 109 for '-' and 187 instead of 61 for
> '='. WebKit and Trident do so.
> 
> ***PATCH***
> 
> source/widget/android/nsWindow.cpp
> line 1434
> Change entire line to:
> case AndroidKeyEvent::KEYCODE_MINUS: return NS_VK_SUBTRACT;

Hi SiPlus, thank you for looking into this. Would you be interested in fixing this bug yourself? We welcome all contributors!

You would create a build environment to build Fennec, create a proper patch file, test the patch, and then I can review your patch. Finally, your patch would be checked into the Fennec source code, and we even mention your name in the weekly meeting! (Similar to this, https://wiki.mozilla.org/Mobile/Notes/02-Jan-2013#Contributors)

If you're interested, let me know and I can guide you through the steps. Thanks! :)
Assignee: nchen → nobody
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(hwguy.siplus)
Whiteboard: [mentor=jchen][lang=c++]
Hi Jim, thank you for replying to this report.

I will try to fix the issue when I get to my PC, currently I have only an Android tablet.
Flags: needinfo?(hwguy.siplus)
(In reply to SiPlus from comment #6)
> Hi Jim, thank you for replying to this report.
> 
> I will try to fix the issue when I get to my PC, currently I have only an
> Android tablet.

Sounds great! I will assign this bug to you for now.

If you have any questions, you can contact me through my Bugzilla email or ask me in the #mobile channel on irc.mozilla.org (my IRC nick is 'jchen') Thanks!
Assignee: nobody → hwguy.siplus
Hi SiPlus, I saw your question on IRC. Building on Windows is not officially supported, but you can install Linux on a virtual machine (using VMWare for example) and build Fennec in there. There is a prebuilt VM available here, http://blog.lassey.us/2011/07/22/updated-android-development-vm/
Hi Jim, thanks for the info, I already found this VM image, I have some issues with free disk space, and it's 12 Gb in size, I'll try to build it when I clear some gigabytes.
Were you able to setup your environment SiPlus? Let me know if you have questions.
Status: NEW → ASSIGNED
Flags: needinfo?(hwguy.siplus)
Oops, missed an email.

Here's what I get:
../../../mobile/android/base/tests/testAwesomebarSwipes.java:33: cannot find symbol
symbol  : method getCurrentItem()
location: class android.support.v4.view.ViewPager
        mAsserter.is(pager.getCurrentItem(), 0, "All pages is selected");
                          ^
../../../mobile/android/base/tests/testAwesomebarSwipes.java:38: cannot find symbol
symbol  : method getCurrentItem()
location: class android.support.v4.view.ViewPager
        mAsserter.is(pager.getCurrentItem(), 1, "Bookmarks page is selected");
                          ^
../../../mobile/android/base/tests/testAwesomebarSwipes.java:41: cannot find symbol
symbol  : method getCurrentItem()
location: class android.support.v4.view.ViewPager
        mAsserter.is(pager.getCurrentItem(), 0, "All pages is selected");
                          ^
../../../mobile/android/base/tests/testAwesomebarSwipes.java:46: cannot find symbol
symbol  : method getCurrentItem()
location: class android.support.v4.view.ViewPager
        mAsserter.is(pager.getCurrentItem(), 1, "Clicking on tab selected bookmarks page");
                          ^
../../../mobile/android/base/tests/testAwesomebarSwipes.java:50: cannot find symbol
symbol  : method getCurrentItem()
location: class android.support.v4.view.ViewPager
        mAsserter.is(pager.getCurrentItem(), 0, "Searching switched to all pages tab");
                          ^
../../../mobile/android/base/tests/testAwesomebarSwipes.java:52: cannot find symbol
symbol  : method getCurrentItem()
location: class android.support.v4.view.ViewPager
        mAsserter.is(pager.getCurrentItem(), 0, "Dragging left is not allowed when searching");
                          ^
../../../mobile/android/base/tests/testAwesomebarSwipes.java:55: cannot find symbol
symbol  : method getCurrentItem()
location: class android.support.v4.view.ViewPager
        mAsserter.is(pager.getCurrentItem(), 0, "Dragging right is not allowed when searching");

And then error 2.
Flags: needinfo?(hwguy.siplus)
I'm trying to build version 18. Version 8 builds properly.
(In reply to SiPlus from comment #12)
> I'm trying to build version 18. Version 8 builds properly.

Can you post your .mozconfig file on http://pastebin.mozilla.org? Thanks!
Flags: needinfo?(hwguy.siplus)
(In reply to Jim Chen [:jchen :nchen] from comment #13)
> (In reply to SiPlus from comment #12)
> > I'm trying to build version 18. Version 8 builds properly.
> 
> Can you post your .mozconfig file on http://pastebin.mozilla.org? Thanks!

http://pastebin.mozilla.org/2058873
Flags: needinfo?(hwguy.siplus)
(In reply to SiPlus from comment #14)
> (In reply to Jim Chen [:jchen :nchen] from comment #13)
> > (In reply to SiPlus from comment #12)
> > > I'm trying to build version 18. Version 8 builds properly.
> > 
> > Can you post your .mozconfig file on http://pastebin.mozilla.org? Thanks!
> 
> http://pastebin.mozilla.org/2058873

Thanks! I added some additional instructions to https://wiki.mozilla.org/Mobile/Fennec/Android#Building_Fennec on how to make the VM build the latest Fennec. You should check to see if you are missing any steps.
Flags: needinfo?(hwguy.siplus)
Assignee: hwguy.siplus → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(hwguy.siplus)
Mentor: nchen
Whiteboard: [mentor=jchen][lang=c++] → [lang=c++]
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly](https://play.google.com/store/apps/details?id=org.mozilla.fenix) an issue can be reported at the [Fenix GitHub project](https://github.com/mozilla-mobile/fenix/). If you want to discuss your report please use [Mozilla's chat](https://wiki.mozilla.org/Matrix#Connect_to_Matrix) server https://chat.mozilla.org and join the [#fenix](https://chat.mozilla.org/#/room/#fenix:mozilla.org) channel.
Status: NEW → RESOLVED
Closed: 11 months ago
Resolution: --- → INCOMPLETE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.