2013-03-15 13:11:33 +00:00
|
|
|
namespace phoenix {
|
|
|
|
|
2012-01-15 08:29:57 +00:00
|
|
|
Position pMouse::position() {
|
|
|
|
QPoint point = QCursor::pos();
|
2013-03-15 13:11:33 +00:00
|
|
|
return {point.x(), point.y()};
|
2012-01-15 08:29:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool pMouse::pressed(Mouse::Button button) {
|
|
|
|
Qt::MouseButtons buttons = QApplication::mouseButtons();
|
|
|
|
switch(button) {
|
|
|
|
case Mouse::Button::Left: return buttons & Qt::LeftButton;
|
|
|
|
case Mouse::Button::Middle: return buttons & Qt::MidButton;
|
|
|
|
case Mouse::Button::Right: return buttons & Qt::RightButton;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2013-03-15 13:11:33 +00:00
|
|
|
|
|
|
|
}
|