mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-18 03:44:32 +01:00
Add input to memview. Use step counters to control updates.
This commit is contained in:
1 parent
adcfffd1d6
commit
11e858f0f1
7 files changed
+75
-22
No files matched your search
@@ -201,6 +201,39 @@ void ImMemView::Draw(ImDrawList *drawList) {
|
||||
}
|
||||
}
|
||||
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
ImVec2 mousePos = ImVec2(io.MousePos.x - canvas_p0.x, io.MousePos.y - canvas_p0.y);
|
||||
if (is_hovered && ImGui::IsMouseClicked(ImGuiMouseButton_Left)) {
|
||||
// INFO_LOG(Log::System, "Mousedown %f,%f active:%d hover:%d", mousePos.x, mousePos.y, is_active, is_hovered);
|
||||
onMouseDown(mousePos.x, mousePos.y, 1);
|
||||
}
|
||||
if (is_hovered && ImGui::IsMouseClicked(ImGuiMouseButton_Right)) {
|
||||
// INFO_LOG(Log::CPU, "Mousedown %f,%f active:%d hover:%d", mousePos.x, mousePos.y, is_active, is_hovered);
|
||||
onMouseDown(mousePos.x, mousePos.y, 2);
|
||||
}
|
||||
if (ImGui::IsMouseReleased(ImGuiMouseButton_Left)) {
|
||||
// INFO_LOG(Log::System, "Mouseup %f,%f active:%d hover:%d", mousePos.x, mousePos.y, is_active, is_hovered);
|
||||
if (is_hovered) {
|
||||
onMouseUp(mousePos.x, mousePos.y, 1);
|
||||
}
|
||||
}
|
||||
if (ImGui::IsMouseDragging(ImGuiMouseButton_Left)) {
|
||||
// INFO_LOG(Log::System, "Mousedrag %f,%f active:%d hover:%d", mousePos.x, mousePos.y, is_active, is_hovered);
|
||||
if (is_hovered) {
|
||||
onMouseMove(mousePos.x, mousePos.y, 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (is_hovered) {
|
||||
if (io.MouseWheel > 0.0f) { // TODO: Scale steps by the value.
|
||||
windowStart_ -= 4;
|
||||
} else if (io.MouseWheel < 0.0f) {
|
||||
windowStart_ += 4;
|
||||
}
|
||||
}
|
||||
|
||||
ProcessKeyboardShortcuts(ImGui::IsItemFocused());
|
||||
|
||||
ImGui_PopFont();
|
||||
drawList->PopClipRect();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user