mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Consider masked modifiers (~S etc.) when writing to bind file
Fixes #12973
This commit is contained in:
parent
3040eb0fa2
commit
eb1ac06a9a
@ -559,11 +559,11 @@ void KeyMap::listBindings(BindingList & list,
|
||||
// a LFUN_COMMAND_PREFIX
|
||||
if (key.prefixes) {
|
||||
KeySequence seq = prefix;
|
||||
seq.addkey(key.code, key.mod.first);
|
||||
seq.addkey(key.code, key.mod.first, key.mod.second);
|
||||
key.prefixes->listBindings(list, seq, tag);
|
||||
} else {
|
||||
KeySequence seq = prefix;
|
||||
seq.addkey(key.code, key.mod.first);
|
||||
seq.addkey(key.code, key.mod.first, key.mod.second);
|
||||
list.push_back(Binding(key.func, seq, tag));
|
||||
}
|
||||
}
|
||||
|
@ -147,16 +147,27 @@ docstring const KeySequence::print(outputFormat format, bool const untranslated)
|
||||
break;
|
||||
case BindFile:
|
||||
KeyModifier mod = modifiers[i].first;
|
||||
KeyModifier nmod = modifiers[i].second;
|
||||
if (mod & ControlModifier)
|
||||
buf += "C-";
|
||||
else if (nmod & ControlModifier)
|
||||
buf += "~C-";
|
||||
if (mod & AltModifier)
|
||||
#if defined(USE_MACOSX_PACKAGING) || defined(USE_META_KEYBINDING)
|
||||
buf += "A-";
|
||||
else if (nmod & AltModifier)
|
||||
buf += "~A-";
|
||||
if (mod & MetaModifier)
|
||||
#endif
|
||||
buf += "M-";
|
||||
#if defined(USE_MACOSX_PACKAGING) || defined(USE_META_KEYBINDING)
|
||||
else if (nmod & MetaModifier)
|
||||
buf += "~M-";
|
||||
#endif
|
||||
if (mod & ShiftModifier)
|
||||
buf += "S-";
|
||||
else if (nmod & ShiftModifier)
|
||||
buf += "~S-";
|
||||
|
||||
buf += from_utf8(sequence[i].getSymbolName());
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user