Base for controller touch screen input

* Supports analog stick, touchpad and gryo as input sources
* Relative and absolute input for sticks and touchpad

Still needs work before ready to merge, UI is not hooked up yet, cursor
drawing is a hack and doesn't work with OpenGL and the input code needs
some refining.
This commit is contained in:
Nadia Holmquist Pedersen
2023-06-30 16:52:19 +02:00
parent 7b948e6ec9
commit 95a1c9555d
4 changed files with 599 additions and 52 deletions

View File

@ -469,6 +469,12 @@ void EmuThread::run()
OSD::AddMessage(0, lid ? "Lid closed" : "Lid opened");
}
if (Input::JoyTouching)
NDS::TouchScreen(Input::JoyTouchX, Input::JoyTouchY);
if (Input::JoyTouchReleased)
NDS::ReleaseScreen();
// microphone input
AudioInOut::MicProcess();
@ -1063,6 +1069,15 @@ void ScreenPanelNative::paintEvent(QPaintEvent* event)
{
painter.setTransform(screenTrans[i]);
painter.drawImage(screenrc, screen[screenKind[i]]);
if (i == 1)
{
//QTransform cursorTrans = screenTrans[i].translate(Input::JoyTouchX, Input::JoyTouchY);
//painter.setTransform(cursorTrans);
QRect cursorRect = QRect(Input::JoyTouchX - 3, Input::JoyTouchY - 3, 5, 5);
painter.setPen(QColor::fromRgb(255, 0, 0));
painter.drawRoundedRect(cursorRect, 5, 5);
}
}
}