Skip to content

Commit

Permalink
Disabled fake mouse events trigggered by touch screens
Browse files Browse the repository at this point in the history
  • Loading branch information
alanspencer committed Oct 18, 2018
1 parent f7011a4 commit 9355418
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/gl3widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -779,8 +779,19 @@ void GlWidget::Rotate(double angle)
void GlWidget::mouseMoveEvent(QMouseEvent *event)
{
//qDebug() << "In Mouse Move Event";

// Make sure the mouse events only come from a real mouse and not something like a touchscreen
if ((event != nullptr) && (event->source() == Qt::MouseEventSource::MouseEventSynthesizedBySystem))
{
qDebug() << "Mouse Event from = " << event->source();
event->ignore();
return;
}

// I fwe have got this far we know this is a real mouse event...
bool donesomething = false;
bool rotmode = false;

if (
event->buttons() & Qt::RightButton
|| ((event->buttons() & Qt::LeftButton) && event->modifiers() == Qt::CTRL)
Expand Down

0 comments on commit 9355418

Please sign in to comment.