fix(editor): guard global shortcuts during ui input
This commit is contained in:
parent
35b394ee37
commit
aa66fd30ec
@ -742,12 +742,20 @@ void MetaCoreReimportProjectAsset(MetaCoreEditorContext& editorContext, const Me
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MetaCoreHandleGlobalEditorShortcuts(MetaCoreEditorContext& editorContext) {
|
[[nodiscard]] bool MetaCoreCanHandleGlobalEditorShortcuts() {
|
||||||
const ImGuiIO& io = ImGui::GetIO();
|
const ImGuiIO& io = ImGui::GetIO();
|
||||||
if (io.WantTextInput) {
|
return !io.WantTextInput &&
|
||||||
|
!io.WantCaptureKeyboard &&
|
||||||
|
!ImGui::IsAnyItemActive() &&
|
||||||
|
!ImGui::IsPopupOpen(nullptr, ImGuiPopupFlags_AnyPopup);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MetaCoreHandleGlobalEditorShortcuts(MetaCoreEditorContext& editorContext) {
|
||||||
|
if (!MetaCoreCanHandleGlobalEditorShortcuts()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const ImGuiIO& io = ImGui::GetIO();
|
||||||
const bool ctrlDown = io.KeyCtrl;
|
const bool ctrlDown = io.KeyCtrl;
|
||||||
const bool shiftDown = io.KeyShift;
|
const bool shiftDown = io.KeyShift;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user