From: Lars Gullik Bjønnes Date: Tue, 19 Dec 2000 00:22:04 +0000 (+0000) Subject: now fix the KP_ stuff, simplify keysym handling in Workarea, this might break other... X-Git-Tag: 1.6.10~21764 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=d0c9adeb069f7d8e19114334fcd754195bc90a9f;p=features.git now fix the KP_ stuff, simplify keysym handling in Workarea, this might break other things please test. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1285 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/ChangeLog b/ChangeLog index 25f0f84823..c54d9d5b0d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,22 @@ +2000-12-19 Lars Gullik Bjønnes + + * src/WorkArea.C (work_area_handler): simplify the key/keysym + handling for XForms 0.89, this might have rendered some cases + unusable. I have at least deadkeys, accent-xxx and KP_x working. + Please report proplems. + + * src/lyxfunc.C (processKeySym): make the self-insert handling + work as it should + +2000-12-18 Baruch Even + + * src/LaTeX.C (deplog): fix spelling errors + * src/text2.C (CutSelection): ditto + * src/lyxfunc.C (Dispatch): ditto + 2000-12-18 Lars Gullik Bjønnes + * lib/layouts/stdlayouts.inc: only allow align Center for Caption * src/mathed/math_inset.C (MathMatrixInset): initialize v_align and h_align in default init. diff --git a/lib/layouts/stdlayouts.inc b/lib/layouts/stdlayouts.inc index 70f096eceb..14a146d953 100644 --- a/lib/layouts/stdlayouts.inc +++ b/lib/layouts/stdlayouts.inc @@ -89,8 +89,8 @@ Style Caption LabelSep xx ParSkip 0.4 TopSep 0.5 - Align Block - AlignPossible Block, Left + Align Center + AlignPossible Center LabelType Sensitive LabelString Caption diff --git a/src/LaTeX.C b/src/LaTeX.C index deaffae9ce..2485f03371 100644 --- a/src/LaTeX.C +++ b/src/LaTeX.C @@ -637,7 +637,7 @@ void LaTeX::deplog(DepTable & head) // Ok now we found a file. // Now we should make sure that this is a file that we can // access through the normal paths. - // We will not try any fance search methods to + // We will not try any fancy search methods to // find the file. // (1) foundfile is an @@ -646,7 +646,7 @@ void LaTeX::deplog(DepTable & head) if (AbsolutePath(foundfile)) { lyxerr[Debug::DEPEND] << "AbsolutePath file: " << foundfile << endl; - // On inital insert we want to do the update at once + // On initial insert we want to do the update at once // since this file can not be a file generated by // the latex run. head.insert(foundfile, true); diff --git a/src/WorkArea.C b/src/WorkArea.C index 57e8e01f18..033c35eddd 100644 --- a/src/WorkArea.C +++ b/src/WorkArea.C @@ -372,18 +372,27 @@ int WorkArea::work_area_handler(FL_OBJECT * ob, int event, if (!key) { // We migth have to add more keysyms here also, // we will do that as the issues arise. (Lgb) - if (keysym == XK_space) + if (keysym == XK_space) { ret_key = keysym; - else + lyxerr[Debug::KEY] << "Using keysym [A]" + << endl; + } else break; } else { // It seems that this was a bit optimistic... // With this hacking things seems to be better (Lgb) - if (static_cast(key) == key - && !iscntrl(key)) - ret_key = key; - else + //if (!iscntrl(key)) { + // ret_key = key; + // lyxerr[Debug::KEY] + // << "Using key [B]\n" + // << "Uchar[" + // << static_cast(key) + // << endl; + //} else { ret_key = (keysym ? keysym : key); + lyxerr[Debug::KEY] << "Using keysym [B]" + << endl; + //} } #endif diff --git a/src/lyxfunc.C b/src/lyxfunc.C index 2510ea6b43..551fb8e4f7 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -273,10 +273,31 @@ int LyXFunc::processKeySym(KeySym keysym, unsigned int state) } else if (action == LFUN_SELFINSERT) { // We must set the argument to the char looked up by // XKeysymToString - char const * tmp = XKeysymToString(keysym); - // if (!argument.empty()) { - argument = tmp ? tmp : ""; - // } + XKeyEvent xke; + xke.type = KeyPress; + xke.serial = 0; + xke.send_event = False; + xke.display = fl_get_display(); + xke.window = 0; + xke.root = 0; + xke.subwindow = 0; + xke.time = 0; + xke.x = 0; + xke.y = 0; + xke.x_root = 0; + xke.y_root = 0; + xke.state = state; + xke.keycode = XKeysymToKeycode(fl_get_display(), keysym); + xke.same_screen = True; + char ret[10]; + KeySym tmpkeysym; + int res = XLookupString(&xke, ret, 10, &tmpkeysym, 0); + //Assert(keysym == tmpkeysym); + lyxerr[Debug::KEY] << "TmpKeysym [" + << tmpkeysym << "]" << endl; + + if (res > 0) + argument = string(ret, res); lyxerr[Debug::KEY] << "SelfInsert arg[" << argument << "]" << endl; } @@ -1823,7 +1844,7 @@ string const LyXFunc::Dispatch(int ac, owner->view()->text->cursor; owner->view()->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); // It is possible to make it a lot faster still - // just comment out the lone below... + // just comment out the line below... owner->view()->showCursor(); } else { owner->view()->cut(); @@ -1939,7 +1960,7 @@ string const LyXFunc::Dispatch(int ac, owner->view()->text->cursor; owner->view()->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); // It is possible to make it a lot faster still - // just comment out the lone below... + // just comment out the line below... owner->view()->showCursor(); } } else { diff --git a/src/mathed/math_iter.C b/src/mathed/math_iter.C index 86146edc7f..2b3212585f 100644 --- a/src/mathed/math_iter.C +++ b/src/mathed/math_iter.C @@ -506,11 +506,13 @@ void MathedXIter::Merge(LyxArrayBase * a0) MathedIter it(a0); LyxArrayBase * a = it.Copy(); - // make rom for the data + // make room for the data split(a->Last()); array->MergeF(a, pos, a->Last()); - int pos1= pos, pos2 = pos + a->Last(); // pos3= 0; + int pos1 = pos; + int pos2 = pos + a->Last(); + // int pos3 = 0; goPosAbs(pos1); diff --git a/src/text2.C b/src/text2.C index 3acc851c45..b5a276a315 100644 --- a/src/text2.C +++ b/src/text2.C @@ -2189,7 +2189,7 @@ void LyXText::CutSelection(BufferView * bview, bool doclear) return; // OK, we have a selection. This is always between sel_start_cursor - // and sel_end cursor + // and sel_end_cursor #ifndef NEW_INSETS // Check whether there are half footnotes in the selection if (sel_start_cursor.par()->footnoteflag != LyXParagraph::NO_FOOTNOTE