Closed Bug 844290 Opened 12 years ago Closed 12 years ago

Refactor key event handling code

Categories

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

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 22

People

(Reporter: jchen, Assigned: jchen)

References

Details

Attachments

(1 file, 1 obsolete file)

As part of the key binding work, I did a refactoring of our key event handling code. I don't see a reason why we need two separate methods to handle key down and key up, so I combined them into one.
This patch combines processKeyDown() and processKeyUp() into one processKey(), because the two methods shared much of the same code. I also isolated various key event workarounds into separate methods.
Attachment #718052 - Flags: review?(cpeterson)
Comment on attachment 718052 [details] [diff] [review] Refactor GeckoInputConnection key handling code (v1) Review of attachment 718052 [details] [diff] [review]: ----------------------------------------------------------------- LGTM ::: mobile/android/base/GeckoInputConnection.java @@ +663,5 @@ > + } > + return true; > + } > + > + private boolean skipKeyListener(int keyCode, KeyEvent event) { Let's call this method something like `shouldSkipKeyListener()`. @@ +723,3 @@ > mEditableClient.sendEvent(GeckoEvent.createKeyEvent(event)); > + if (skip) { > + TextKeyListener.adjustMetaAfterKeypress(uiEditable); Can you add a brief comment explaining why or when we need to skip and adjust the meta state?
Attachment #718052 - Flags: review?(cpeterson) → review+
Addressed review comments and fixed a bug where meta states are adjusted on key up, which is incorrect (Android only adjusts meta states on key down)
Attachment #718052 - Attachment is obsolete: true
Attachment #719513 - Flags: review+
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 22
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: