зеркало из https://github.com/mozilla/pjs.git
Bug 697773 - Cannot type in AwesomeBar URL bar with hard keyboard. r=blassey
This commit is contained in:
Родитель
b17b3fe62e
Коммит
e449122f9f
|
@ -148,6 +148,25 @@ public class AwesomeBar extends Activity {
|
|||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
// This method is called only if the key event was not handled
|
||||
// by any of the views, which usually means the edit box lost focus
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK ||
|
||||
keyCode == KeyEvent.KEYCODE_DPAD_UP ||
|
||||
keyCode == KeyEvent.KEYCODE_DPAD_DOWN ||
|
||||
keyCode == KeyEvent.KEYCODE_DPAD_LEFT ||
|
||||
keyCode == KeyEvent.KEYCODE_DPAD_RIGHT ||
|
||||
keyCode == KeyEvent.KEYCODE_DPAD_CENTER) {
|
||||
return super.onKeyDown(keyCode, event);
|
||||
} else {
|
||||
// Return focus to the edit box, and dispatch the event to it
|
||||
mText.requestFocusFromTouch();
|
||||
mText.dispatchKeyEvent(event);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
|
Загрузка…
Ссылка в новой задаче