blob: a6081809b3cbfa036ec1e55f28a9cf557f62e2ba (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#include "qt/qt_common/helpers.hpp"
namespace qt
{
namespace common
{
bool IsLeftButton(Qt::MouseButtons buttons) { return buttons & Qt::LeftButton; }
bool IsLeftButton(QMouseEvent const * const e)
{
return IsLeftButton(e->button()) || IsLeftButton(e->buttons());
}
bool IsRightButton(Qt::MouseButtons buttons) { return buttons & Qt::RightButton; }
bool IsRightButton(QMouseEvent const * const e)
{
return IsRightButton(e->button()) || IsRightButton(e->buttons());
}
bool IsCommandModifier(QMouseEvent const * const e) { return e->modifiers() & Qt::ControlModifier; }
bool IsShiftModifier(QMouseEvent const * const e) { return e->modifiers() & Qt::ShiftModifier; }
bool IsAltModifier(QMouseEvent const * const e) { return e->modifiers() & Qt::AltModifier; }
} // namespace common
} // namespace qt
|