mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Patch from Ben M.: do not accept key events if we do not know what these keys
stand for. This fixes bug #6043: Windows multimedia keys intercepted git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30389 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
14c5adf034
commit
5784b88f65
@ -141,10 +141,11 @@ void ShortcutWidget::appendToSequence(QKeyEvent * e)
|
||||
{
|
||||
KeySymbol sym;
|
||||
setKeySymbol(&sym, e);
|
||||
|
||||
KeyModifier mod = lyx::q_key_state(e->modifiers());
|
||||
|
||||
keysequence_.addkey(sym, mod, lyx::NoModifier);
|
||||
if (sym.isOK()) {
|
||||
KeyModifier mod = lyx::q_key_state(e->modifiers());
|
||||
keysequence_.addkey(sym, mod, lyx::NoModifier);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -638,7 +638,7 @@ void KeySymbol::init(string const & symbolname)
|
||||
|
||||
bool KeySymbol::isOK() const
|
||||
{
|
||||
bool const ok = !(text_.empty() && key_ == Qt::Key_unknown);
|
||||
bool const ok = !(text_.empty() && qkey_to_string(key_).empty());
|
||||
LYXERR(Debug::KEY, "isOK is " << ok);
|
||||
return ok;
|
||||
}
|
||||
|
@ -902,8 +902,12 @@ void GuiWorkArea::keyPressEvent(QKeyEvent * ev)
|
||||
|
||||
KeySymbol sym;
|
||||
setKeySymbol(&sym, ev);
|
||||
processKeySym(sym, q_key_state(ev->modifiers()));
|
||||
ev->accept();
|
||||
if (sym.isOK()) {
|
||||
processKeySym(sym, q_key_state(ev->modifiers()));
|
||||
ev->accept();
|
||||
} else {
|
||||
ev->ignore();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user