diff --git a/src/frontend/qt_sdl/main.cpp b/src/frontend/qt_sdl/main.cpp index 00135b40..c4da68f2 100644 --- a/src/frontend/qt_sdl/main.cpp +++ b/src/frontend/qt_sdl/main.cpp @@ -808,6 +808,17 @@ QSize ScreenHandler::screenGetMinSize(int factor = 1) void ScreenHandler::screenOnMousePress(QMouseEvent* event) { event->accept(); + + if (event->button() == Qt::RightButton) + { + // FAZIL + if (numTouch < 10) + {printf("ADDING A FUCKING FAZIL %d\n", numTouch); + touchPos[numTouch] = event->pos(); + numTouch++; + } + } + if (event->button() != Qt::LeftButton) return; int x = event->pos().x(); @@ -933,6 +944,7 @@ ScreenPanelNative::ScreenPanelNative(QWidget* parent) : QWidget(parent) screenTrans[1].reset(); touching = false; + numTouch = 0; setAttribute(Qt::WA_AcceptTouchEvents); @@ -993,6 +1005,17 @@ void ScreenPanelNative::paintEvent(QPaintEvent* event) } } + for (int i = 0; i < numTouch; i++) + { + QPoint pos = touchPos[i]; + QColor col = numberColors[i]; + + painter.setPen(col); + painter.drawLine(pos.x()-2, pos.y(), pos.x()+2, pos.y()); + painter.drawLine(pos.x(), pos.y()-2, pos.x(), pos.y()+2); + painter.drawLine(0, 0, 100, 100); + } + OSD::Update(nullptr); OSD::DrawNative(painter); } @@ -1044,6 +1067,7 @@ void ScreenPanelNative::onScreenLayoutChanged() ScreenPanelGL::ScreenPanelGL(QWidget* parent) : QOpenGLWidget(parent) { touching = false; + numTouch = 0; setAttribute(Qt::WA_AcceptTouchEvents); } diff --git a/src/frontend/qt_sdl/main.h b/src/frontend/qt_sdl/main.h index 6466e3b9..b423bf2d 100644 --- a/src/frontend/qt_sdl/main.h +++ b/src/frontend/qt_sdl/main.h @@ -122,6 +122,22 @@ protected: int numScreens; bool touching; + QPoint touchPos[10]; + int numTouch; + + const QColor numberColors[10] = + { + QColor(0xFF, 0xFF, 0xFF), + QColor(0x00, 0x00, 0x00), + QColor(0x00, 0x96, 0x27), + QColor(0x5D, 0x26, 0xFF), + QColor(0xFF, 0xF8, 0x00), + QColor(0xFF, 0x37, 0x00), + QColor(0x00, 0xDD, 0xFF), + QColor(0xFF, 0x90, 0x47), + QColor(0xFF, 0xCC, 0xCC), + QColor(0x4F, 0x1A, 0x00) + }; void showCursor(); };