fix broken greek keyboard input

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2631 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2001-08-30 14:40:43 +00:00
parent b3f111bd93
commit dcc9fe59dd

View File

@ -1313,20 +1313,28 @@ void MathCursor::interpret(string const & s)
} }
if (isalpha(c) && (lastcode_ == LM_TC_GREEK || lastcode_ == LM_TC_GREEK1)) { if (isalpha(c) && (lastcode_ == LM_TC_GREEK || lastcode_ == LM_TC_GREEK1)) {
static char const greek[26] = static char const greekl[][26] =
{'A', 'B', 'X', 0 , 'E', 0 , 0 , 'H', 'I', 0 , {"alpha", "beta", "chi", "delta", "epsilon", "phi", "gamma", "eta",
'K', 0 , 'M', 'N', 'O', 0 , 0 , 'P', 0 , 'T', "iota", "", "kappa", "lambda", "mu", "nu", "omikron", "pi", "omega",
0, 0, 0, 0, 0 , 'Z' }; "rho", "sigma", "tau", "theta", "", "", "xi", "ypsilon", "zeta"};
static char const greeku[][26] =
MathTextCodes code = LM_TC_SYMB; {"Alpha", "Beta", "Chi", "Delta", "Epsilon", "Phi", "Gamma", "Eta",
if ('A' <= c && c <= 'Z' && greek[c - 'A']) { "Iota", "", "Kappa", "Lambda", "Mu", "Nu", "Omikron", "Pi", "Omega",
code = LM_TC_RM; "Rho", "Sigma", "Tau", "Theta", "", "", "xi", "Ypsilon", "Zeta"};
c = greek[c - 'A'];
}
insert(c, code);
latexkeys const * l = 0;
if ('a' <= c && c <= 'z')
l = in_word_set(greekl[c - 'a']);
if ('A' <= c && c <= 'Z')
l = in_word_set(greeku[c - 'A']);
if (l)
insert(createMathInset(l));
else
insert(c, LM_TC_VAR);
#warning greek insert problem? look here! #warning greek insert problem? look here!
//if (lastcode_ == LM_TC_GREEK1) if (lastcode_ == LM_TC_GREEK1)
lastcode_ = LM_TC_VAR; lastcode_ = LM_TC_VAR;
return; return;
} }