mirror of
https://github.com/Rosalie241/RMG.git
synced 2026-07-11 01:24:01 +02:00
add right mouse button support to rt64
This commit is contained in:
+6
-1
@@ -243,7 +243,7 @@ DLLEXPORT void CALL MouseMove(int x, int y)
|
||||
event.motion.y = y;
|
||||
|
||||
if (RT64::API.app->presentQueue->inspector != nullptr) {
|
||||
printf("MouseMove x = %i, y = %i\n", x,y);
|
||||
//printf("MouseMove x = %i, y = %i\n", x,y);
|
||||
ImGui_ImplSDL2_ProcessEvent(&event);
|
||||
}
|
||||
}
|
||||
@@ -253,9 +253,14 @@ DLLEXPORT void CALL MouseButton(int left, int right)
|
||||
if (RT64::API.app->presentQueue->inspector != nullptr) {
|
||||
printf("MouseButton left = %i\n", left);
|
||||
SDL_Event event;
|
||||
|
||||
event.type = left ? SDL_MOUSEBUTTONDOWN : SDL_MOUSEBUTTONUP;
|
||||
event.button.button = SDL_BUTTON_LEFT;
|
||||
ImGui_ImplSDL2_ProcessEvent(&event);
|
||||
|
||||
event.type = right ? SDL_MOUSEBUTTONDOWN : SDL_MOUSEBUTTONUP;
|
||||
event.button.button = SDL_BUTTON_RIGHT;
|
||||
ImGui_ImplSDL2_ProcessEvent(&event);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1293,7 +1293,10 @@ void MainWindow::on_EventFilter_MouseButtonPressed(QMouseEvent *event)
|
||||
return;
|
||||
}
|
||||
|
||||
CoreSetMouseButton((event->button() == Qt::MouseButton::LeftButton ? 1 : 0), (event->button() == Qt::MouseButton::RightButton ? 1 : 0));
|
||||
this->ui_LeftMouseButtonState = (event->button() == Qt::MouseButton::LeftButton ? 1 : this->ui_LeftMouseButtonState);
|
||||
this->ui_RightMouseButtonState = (event->button() == Qt::MouseButton::RightButton ? 1 : this->ui_RightMouseButtonState);
|
||||
|
||||
CoreSetMouseButton(this->ui_LeftMouseButtonState, this->ui_RightMouseButtonState);
|
||||
}
|
||||
|
||||
void MainWindow::on_EventFilter_MouseButtonReleased(QMouseEvent *event)
|
||||
@@ -1304,7 +1307,10 @@ void MainWindow::on_EventFilter_MouseButtonReleased(QMouseEvent *event)
|
||||
return;
|
||||
}
|
||||
|
||||
CoreSetMouseButton((event->button() == Qt::MouseButton::LeftButton ? 0 : 1), (event->button() == Qt::MouseButton::RightButton ? 0 : 1));
|
||||
this->ui_LeftMouseButtonState = (event->button() == Qt::MouseButton::LeftButton ? 0 : this->ui_LeftMouseButtonState);
|
||||
this->ui_RightMouseButtonState = (event->button() == Qt::MouseButton::RightButton ? 0 : this->ui_RightMouseButtonState);
|
||||
|
||||
CoreSetMouseButton(this->ui_LeftMouseButtonState, this->ui_RightMouseButtonState);
|
||||
}
|
||||
|
||||
void MainWindow::on_EventFilter_FileDropped(QDropEvent *event)
|
||||
|
||||
@@ -120,6 +120,9 @@ class MainWindow : public QMainWindow, private Ui::MainWindow
|
||||
int ui_LoadSaveStateSlotCounter = 0;
|
||||
int ui_LoadSaveStateSlotTimerId = -1;
|
||||
|
||||
int ui_LeftMouseButtonState = 0;
|
||||
int ui_RightMouseButtonState = 0;
|
||||
|
||||
QString ui_WindowTitle;
|
||||
|
||||
Dialog::LogDialog logDialog;
|
||||
|
||||
Reference in New Issue
Block a user