NS_IS_ALPHA uses isalpha, which depends on locale, so may produce some
surprises.
We also need to be careful about changing event.charCode if there is a Latin
character is the current group. If Ctrl-/ is a meaningful shortcut, then I
guess it should be preferred over Ctrl-Q (with Ctrl-Q tried as fallback).
Simon, Dotan, Eyal, Haggai, or Yehuda, or Tomer, tell me if a Hebrew user
would think otherwise?
I can think of two possible alternatives for needLatinKeyCodes:
a) Provide the basic Latin letter or numeral as an alternative when and only
when that basic letter or numeral is not available on level 0 of the
current group, or
b) Look for a basic Latin letter or numeral only when the current group does
not look like a Latin layout. That perhaps can be tested through looking
for one or more specific Latin letters on level 0 of the current layout. I
wonder whether any layouts have an "a" but not the rest of the Latin
alphabet. I wonder whether any Latin layouts do not have "z".
(In reply to comment #12) odes) { altCharCodes. mUnshiftedCharC ode); altCharCodes. mShiftedCharCod e);
> + PRBool needLatinKeyCodes = !isLatin;
> + if (!needLatinKeyC
> + PRBool isAlpha1 = NS_IS_ALPHA(
> + PRBool isAlpha2 = NS_IS_ALPHA(
> + needLatinKeyCodes = (isAlpha1 && !isAlpha2) || (!isAlpha1 && isAlpha2);
> + }
>
> - if (isLatin) {
> + if (needLatinKeyCodes) {
NS_IS_ALPHA uses isalpha, which depends on locale, so may produce some
surprises.
We also need to be careful about changing event.charCode if there is a Latin
character is the current group. If Ctrl-/ is a meaningful shortcut, then I
guess it should be preferred over Ctrl-Q (with Ctrl-Q tried as fallback).
Simon, Dotan, Eyal, Haggai, or Yehuda, or Tomer, tell me if a Hebrew user
would think otherwise?
I can think of two possible alternatives for needLatinKeyCodes:
a) Provide the basic Latin letter or numeral as an alternative when and only
when that basic letter or numeral is not available on level 0 of the
current group, or
b) Look for a basic Latin letter or numeral only when the current group does
not look like a Latin layout. That perhaps can be tested through looking
for one or more specific Latin letters on level 0 of the current layout. I
wonder whether any layouts have an "a" but not the rest of the Latin
alphabet. I wonder whether any Latin layouts do not have "z".