Yes, we can merge this two logic together. This can also prevent the
keyboard's basicLayoutKey overwrite to the base alternateLayout.

At the beginning I try to define basicLayoutKey in my new added keyboard's
alternateLayout and symbolLayout. The basicLayoutKey is good in my
keyboard, but for those which use the base alternateLayout it is not.

BTW, I think one basicLayoutKey per keyboard is enough. No need to define
basicLayoutKey in its alternateLayout and symbolLayout.

How do you think?
 2013/9/11 ¤U¤È7:11 ©ó "Rudy Lu" <notifications@github.com> ¼g¹D¡G

> In apps/keyboard/js/keyboard.js:
>
> > @@ -647,6 +647,12 @@ function modifyLayout(keyboardName) {
> >    var layout;
> >    if (altLayoutName) {
> >      layout = Keyboards[keyboardName][altLayoutName] || Keyboards[altLayoutName];
> > +    if (Keyboards[keyboardName]['basicLayoutKey']) {
> > +      layout['basicLayoutKey'] = Keyboards[keyboardName]['basicLayoutKey'];
> > +    }
> > +    else {
> > +      layout['basicLayoutKey'] = null;
> > +    }
>
> What if that language has its own alternateLayout and that `
> alternateLayout has its defined basicLayoutKey?
>
> Besides, starting from the following line, we have some logic to replace
> basicLayoutKey, can we combine the logic you added to that?
>
> https://github.com/Seinlin/gaia/blob/71c3fa6e28533527f77084fd20d3de78d4b37c5b/apps/keyboard/js/keyboard.js#L694
>
> ¡X
> Reply to this email directly or view it on GitHub<https://github.com/mozilla-b2g/gaia/pull/12100/files#r6290940>
> .
>