2012-02-20 21:47:14 +00:00
|
|
|
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
|
2009-02-01 00:08:08 +00:00
|
|
|
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
|
|
|
|
|
|
|
|
#include "keyboardstate.hh"
|
2009-02-05 16:56:57 +00:00
|
|
|
|
2024-06-26 07:58:42 +00:00
|
|
|
#include <QApplication>
|
2009-02-01 00:08:08 +00:00
|
|
|
|
|
|
|
bool KeyboardState::checkModifiersPressed( int mask )
|
|
|
|
{
|
2024-06-26 07:58:42 +00:00
|
|
|
auto modifiers = QApplication::queryKeyboardModifiers();
|
2023-07-20 08:02:22 +00:00
|
|
|
|
2024-06-26 07:58:42 +00:00
|
|
|
return !( ( mask & Alt && !( modifiers.testFlag( Qt::AltModifier ) ) )
|
|
|
|
|| ( mask & Ctrl && !( modifiers.testFlag( Qt::ControlModifier ) ) )
|
|
|
|
|| ( mask & Shift && !( modifiers.testFlag( Qt::ShiftModifier ) ) ) );
|
2009-02-01 00:08:08 +00:00
|
|
|
}
|