From: Lars Gullik Bjønnes Date: Thu, 17 May 2001 01:23:29 +0000 (+0000) Subject: better latingkeys and better handling of unknown lyxfuncs X-Git-Tag: 1.6.10~21242 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=d9737c95601ceaa7a79c55ab5d215fbec2148362;p=features.git better latingkeys and better handling of unknown lyxfuncs git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2003 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/lib/ChangeLog b/lib/ChangeLog index d9ef3e463c..817e6e827a 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,7 @@ +2001-05-17 Lars Gullik Bjønnes + + * bind/latinkeys.bind: fixup more bindings. + 2001-05-16 Jean-Marc Lasgouttes * bind/latinkeys.bind: fix typo diff --git a/lib/bind/latinkeys.bind b/lib/bind/latinkeys.bind index 4b320b8b41..fc69964b5c 100644 --- a/lib/bind/latinkeys.bind +++ b/lib/bind/latinkeys.bind @@ -35,32 +35,32 @@ \bind "greater" "self-insert" \bind "question" "self-insert" \bind "at" "self-insert" -\bind "~S-A" "self-insert" -\bind "~S-B" "self-insert" -\bind "~S-C" "self-insert" -\bind "~S-D" "self-insert" -\bind "~S-E" "self-insert" -\bind "~S-F" "self-insert" -\bind "~S-G" "self-insert" -\bind "~S-H" "self-insert" -\bind "~S-I" "self-insert" -\bind "~S-J" "self-insert" -\bind "~S-K" "self-insert" -\bind "~S-L" "self-insert" -\bind "~S-M" "self-insert" -\bind "~S-N" "self-insert" -\bind "~S-O" "self-insert" -\bind "~S-P" "self-insert" -\bind "~S-Q" "self-insert" -\bind "~S-R" "self-insert" -\bind "~S-S" "self-insert" -\bind "~S-T" "self-insert" -\bind "~S-U" "self-insert" -\bind "~S-V" "self-insert" -\bind "~S-W" "self-insert" -\bind "~S-X" "self-insert" -\bind "~S-Y" "self-insert" -\bind "~S-Z" "self-insert" +\bind "A" "self-insert" +\bind "B" "self-insert" +\bind "C" "self-insert" +\bind "D" "self-insert" +\bind "E" "self-insert" +\bind "F" "self-insert" +\bind "G" "self-insert" +\bind "H" "self-insert" +\bind "I" "self-insert" +\bind "J" "self-insert" +\bind "K" "self-insert" +\bind "L" "self-insert" +\bind "M" "self-insert" +\bind "N" "self-insert" +\bind "O" "self-insert" +\bind "P" "self-insert" +\bind "Q" "self-insert" +\bind "R" "self-insert" +\bind "S" "self-insert" +\bind "T" "self-insert" +\bind "U" "self-insert" +\bind "V" "self-insert" +\bind "W" "self-insert" +\bind "X" "self-insert" +\bind "Y" "self-insert" +\bind "Z" "self-insert" \bind "bracketleft" "self-insert" \bind "backslash" "self-insert" \bind "bracketright" "self-insert" @@ -131,38 +131,38 @@ \bind "onehalf" "self-insert" \bind "threequarters" "self-insert" \bind "questiondown" "self-insert" -\bind "~S-Agrave" "accent-grave A" -\bind "~S-Aacute" "accent-acute A" -\bind "~S-Acircumflex" "accent-circumflex A" -\bind "~S-Atilde" "accent-tilde A" -\bind "~S-Adiaeresis" "accent-umlaut A" -\bind "~S-Aring" "accent-circle A" -\bind "~S-AE" "self-insert" -\bind "~S-Ccedilla" "accent-cedilla C" -\bind "~S-Egrave" "accent-grave E" -\bind "~S-Eacute" "accent-acute E" -\bind "~S-Ecircumflex" "accent-circumflex E" -\bind "~S-Ediaeresis" "accent-umlaut E" -\bind "~S-Igrave" "accent-grave I" -\bind "~S-Iacute" "accent-acute I" -\bind "~S-Icircumflex" "accent-circumflex I" -\bind "~S-Idiaeresis" "accent-umlaut I" +\bind "Agrave" "accent-grave A" +\bind "Aacute" "accent-acute A" +\bind "Acircumflex" "accent-circumflex A" +\bind "Atilde" "accent-tilde A" +\bind "Adiaeresis" "accent-umlaut A" +\bind "Aring" "accent-circle A" +\bind "AE" "self-insert" +\bind "Ccedilla" "accent-cedilla C" +\bind "Egrave" "accent-grave E" +\bind "Eacute" "accent-acute E" +\bind "Ecircumflex" "accent-circumflex E" +\bind "Ediaeresis" "accent-umlaut E" +\bind "Igrave" "accent-grave I" +\bind "Iacute" "accent-acute I" +\bind "Icircumflex" "accent-circumflex I" +\bind "Idiaeresis" "accent-umlaut I" \bind "ETH" "self-insert" \bind "Eth" "self-insert" -\bind "~S-Ntilde" "accent-tilde N" -\bind "~S-Ograve" "accent-grave O" -\bind "~S-Oacute" "accent-acute O" -\bind "~S-Ocircumflex" "accent-circumflex O" -\bind "~S-Otilde" "accent-tilde O" -\bind "~S-Odiaeresis" "accent-umlaut O" +\bind "Ntilde" "accent-tilde N" +\bind "Ograve" "accent-grave O" +\bind "Oacute" "accent-acute O" +\bind "Ocircumflex" "accent-circumflex O" +\bind "Otilde" "accent-tilde O" +\bind "Odiaeresis" "accent-umlaut O" \bind "multiply" "self-insert" \bind "Ooblique" "self-insert" \bind "Oslash" "self-insert" -\bind "~S-Ugrave" "accent-grave U" -\bind "~S-Uacute" "accent-acute U" -\bind "~S-Ucircumflex" "accent-circumflex U" -\bind "~S-Udiaeresis" "accent-umlaut U" -\bind "~S-Yacute" "accent-acute Y" +\bind "Ugrave" "accent-grave U" +\bind "Uacute" "accent-acute U" +\bind "Ucircumflex" "accent-circumflex U" +\bind "Udiaeresis" "accent-umlaut U" +\bind "Yacute" "accent-acute Y" \bind "THORN" "self-insert" \bind "Thorn" "self-insert" \bind "ssharp" "self-insert" @@ -357,4 +357,4 @@ \bind "OE" "self-insert" \bind "oe" "self-insert" -\bind "~S-Ydiaeresis" "accent-umlaut Y" +\bind "Ydiaeresis" "accent-umlaut Y" diff --git a/src/ChangeLog b/src/ChangeLog index 9f667c9926..b1cd932c7f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2001-05-17 Lars Gullik Bjønnes + + * lyxfunc.[Ch] (processKeySym): return void. Handle unknown actions + better by trying again with reduced state. + 2001-05-16 Jean-Marc Lasgouttes * lyxrc.C (read): print error about invalid key sequence only when diff --git a/src/lyxfunc.C b/src/lyxfunc.C index dc9271f670..45accd22ab 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -214,12 +214,12 @@ void LyXFunc::handleKeyFunc(kb_action action) } -int LyXFunc::processKeySym(KeySym keysym, unsigned int state) +void LyXFunc::processKeySym(KeySym keysym, unsigned int state) { string argument; if (lyxerr.debugging(Debug::KEY)) { - char * tmp = XKeysymToString(keysym); + char const * tmp = XKeysymToString(keysym); string const stm = (tmp ? tmp : ""); lyxerr << "KeySym is " << stm @@ -233,7 +233,8 @@ int LyXFunc::processKeySym(KeySym keysym, unsigned int state) lyxerr[Debug::KEY] << "Empty kbd action (probably composing)" << endl; //return 0; - return FL_PREEMPT; + //return FL_PREEMPT; + return; } if (owner->view()->available()) { @@ -251,7 +252,8 @@ int LyXFunc::processKeySym(KeySym keysym, unsigned int state) true); } //return 0; - return FL_PREEMPT; + //return FL_PREEMPT; + return; } } @@ -260,9 +262,11 @@ int LyXFunc::processKeySym(KeySym keysym, unsigned int state) // This code snippet makes lyx ignore some keys. Perhaps // all of them should be explictly mentioned? if ((keysym >= XK_Shift_L && keysym <= XK_Hyper_R) - || keysym == XK_Mode_switch || keysym == 0x0) - return 0; - + || keysym == XK_Mode_switch || keysym == 0x0) { + //return 0; + return; + } + // Do a one-deep top-level lookup for // cancel and meta-fake keys. RVDK_PATCH_5 cancel_meta_seq.reset(); @@ -338,10 +342,28 @@ int LyXFunc::processKeySym(KeySym keysym, unsigned int state) return 0; } #else - owner->message(_("Unknown function.")); - return 0; + // It is unknown, but what if we remove all + // the modifiers? (Lgb) + action = keyseq.addkey(keysym, 0); + + // We keep the shift state, but remove the others. + // This is for the sake of the LFUN_SELFINSERT below. + state &= ShiftMask; + + if (lyxerr.debugging(Debug::KEY)) { + lyxerr << "Removing modifiers...\n" + << "Action now set to [" + << action << "]" << endl; + } + if (action == -1) { + owner->message(_("Unknown function.")); + //return 0; + return; + } #endif - } else if (action == LFUN_SELFINSERT) { + } + + if (action == LFUN_SELFINSERT) { // We must set the argument to the char looked up by // XKeysymToString XKeyEvent xke; @@ -369,6 +391,7 @@ int LyXFunc::processKeySym(KeySym keysym, unsigned int state) if (res > 0) argument = string(ret, res); + lyxerr[Debug::KEY] << "SelfInsert arg[" << argument << "]" << endl; } @@ -379,7 +402,7 @@ int LyXFunc::processKeySym(KeySym keysym, unsigned int state) Dispatch(action, argument); show_sc = tmp_sc; - return 0; + //return 0; } diff --git a/src/lyxfunc.h b/src/lyxfunc.h index c281020cf3..e9ad1d6b7d 100644 --- a/src/lyxfunc.h +++ b/src/lyxfunc.h @@ -55,7 +55,7 @@ public: void initMiniBuffer(); /// - int processKeySym(KeySym k, unsigned int state); + void processKeySym(KeySym k, unsigned int state); /// we need one internall which is called from inside LyXAction and /// can contain the string argument.