|
@@ -261,17 +261,17 @@ void ControlOperationPage::UpDateCameraBind(CameraBind* pCameraBind)
|
|
|
|
|
|
void ControlOperationPage::on_switchJoystickBut_clicked()
|
|
|
{
|
|
|
+ m_isUserOnclick = true;
|
|
|
ResetIdleTimer(true);
|
|
|
}
|
|
|
|
|
|
void ControlOperationPage::MouseMovedSlots(const QPoint& delta)
|
|
|
{
|
|
|
- qDebug() << "MouseMovedSlots:" << delta;
|
|
|
+ qDebug() << "MouseMovedSlots:" << delta;
|
|
|
if (m_pCameraBindCopy)
|
|
|
{
|
|
|
m_pCameraBindCopy->JCameraMove(0, delta.x(), delta.y());
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
void ControlOperationPage::RequestCursorMoveSlots(const QPoint& pos)
|
|
@@ -285,6 +285,7 @@ void ControlOperationPage::timerEvent(QTimerEvent* event)
|
|
|
if (nID == m_idleTimer)
|
|
|
{
|
|
|
ResetIdleTimer(false);
|
|
|
+ m_isUserOnclick = false;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -305,6 +306,30 @@ void ControlOperationPage::mouseMoveEvent(QMouseEvent* event)
|
|
|
int a = 10;
|
|
|
}
|
|
|
|
|
|
+bool ControlOperationPage::eventFilter(QObject* obj, QEvent* event)
|
|
|
+{
|
|
|
+ switch (event->type())
|
|
|
+ {
|
|
|
+ case QEvent::KeyPress:
|
|
|
+ case QEvent::MouseMove:
|
|
|
+ case QEvent::MouseButtonPress:
|
|
|
+ case QEvent::MouseButtonDblClick:
|
|
|
+ case QEvent::Wheel:
|
|
|
+ {
|
|
|
+ if (m_isUserOnclick)
|
|
|
+ {
|
|
|
+ ResetIdleTimer(false);
|
|
|
+ ResetIdleTimer(true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ return QWidget::eventFilter(obj, event);
|
|
|
+}
|
|
|
+
|
|
|
void ControlOperationPage::HideLayout(bool bShow)
|
|
|
{
|
|
|
for (int i = 0; i < ui->horizontalLayout->count(); ++i)
|
|
@@ -346,6 +371,7 @@ void ControlOperationPage::InitWnd()
|
|
|
HideLayout(false);
|
|
|
|
|
|
this->setMouseTracking(true);
|
|
|
+ this->installEventFilter(this);
|
|
|
}
|
|
|
|
|
|
void ControlOperationPage::CreateMouseMonitor(bool isStart)
|