mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-27 00:00:07 -06:00
add touchscreen input
This commit is contained in:
@ -479,6 +479,8 @@ void EmuThread::run()
|
||||
else
|
||||
{
|
||||
NDS::SetKeyMask(Input::InputMask);
|
||||
if (Input::Touching) NDS::TouchScreen(Input::TouchX, Input::TouchY);
|
||||
else NDS::ReleaseScreen();
|
||||
}
|
||||
|
||||
if (Input::HotkeyPressed(HK_Lid))
|
||||
@ -923,7 +925,7 @@ void ScreenHandler::screenOnMousePress(QMouseEvent* event)
|
||||
if (Frontend::GetTouchCoords(x, y, false))
|
||||
{
|
||||
touching = true;
|
||||
NDS::TouchScreen(x, y);
|
||||
Input::TouchScreen(x, y);
|
||||
}
|
||||
}
|
||||
|
||||
@ -935,7 +937,7 @@ void ScreenHandler::screenOnMouseRelease(QMouseEvent* event)
|
||||
if (touching)
|
||||
{
|
||||
touching = false;
|
||||
NDS::ReleaseScreen();
|
||||
Input::ReleaseScreen();
|
||||
}
|
||||
}
|
||||
|
||||
@ -952,7 +954,7 @@ void ScreenHandler::screenOnMouseMove(QMouseEvent* event)
|
||||
int y = event->pos().y();
|
||||
|
||||
if (Frontend::GetTouchCoords(x, y, true))
|
||||
NDS::TouchScreen(x, y);
|
||||
Input::TouchScreen(x, y);
|
||||
}
|
||||
|
||||
void ScreenHandler::screenHandleTablet(QTabletEvent* event)
|
||||
@ -970,14 +972,14 @@ void ScreenHandler::screenHandleTablet(QTabletEvent* event)
|
||||
if (Frontend::GetTouchCoords(x, y, event->type()==QEvent::TabletMove))
|
||||
{
|
||||
touching = true;
|
||||
NDS::TouchScreen(x, y);
|
||||
Input::TouchScreen(x, y);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case QEvent::TabletRelease:
|
||||
if (touching)
|
||||
{
|
||||
NDS::ReleaseScreen();
|
||||
Input::ReleaseScreen();
|
||||
touching = false;
|
||||
}
|
||||
break;
|
||||
@ -1003,14 +1005,14 @@ void ScreenHandler::screenHandleTouch(QTouchEvent* event)
|
||||
if (Frontend::GetTouchCoords(x, y, event->type()==QEvent::TouchUpdate))
|
||||
{
|
||||
touching = true;
|
||||
NDS::TouchScreen(x, y);
|
||||
Input::TouchScreen(x, y);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case QEvent::TouchEnd:
|
||||
if (touching)
|
||||
{
|
||||
NDS::ReleaseScreen();
|
||||
Input::ReleaseScreen();
|
||||
touching = false;
|
||||
}
|
||||
break;
|
||||
|
Reference in New Issue
Block a user