mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2024-11-14 13:27:41 -07:00
Ignore touch events originating from trackpads
Fixes multi-finger gestures causing spurious touch screen presses Also fix some deprecations when we're at it anyway
This commit is contained in:
parent
2031f491f0
commit
6d2ad2a3f0
@ -302,15 +302,18 @@ void ScreenPanel::tabletEvent(QTabletEvent* event)
|
||||
|
||||
void ScreenPanel::touchEvent(QTouchEvent* event)
|
||||
{
|
||||
if (event->deviceType() == QInputDevice::DeviceType::TouchPad)
|
||||
return;
|
||||
|
||||
event->accept();
|
||||
|
||||
switch(event->type())
|
||||
{
|
||||
case QEvent::TouchBegin:
|
||||
case QEvent::TouchUpdate:
|
||||
if (event->touchPoints().length() > 0)
|
||||
if (event->points().length() > 0)
|
||||
{
|
||||
QPointF lastPosition = event->touchPoints().first().lastPos();
|
||||
QPointF lastPosition = event->points().first().lastPosition();
|
||||
int x = (int)lastPosition.x();
|
||||
int y = (int)lastPosition.y();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user