mirror of
https://github.com/ARMSX2/ARMSX2.git
synced 2026-08-24 16:50:16 -07:00
Qt/ImGui: Use macOS keyboard behaviors
Signed-off-by: SternXD <stern@sidestore.io>
This commit is contained in:
@@ -590,6 +590,12 @@ u32 QtUtils::KeyEventToCode(const QKeyEvent* ev)
|
||||
modifiers &= ~Qt::KeypadModifier;
|
||||
}
|
||||
}
|
||||
|
||||
// Undo Qt's swapping of Control and Command on macOS.
|
||||
if (key == Qt::Key_Control)
|
||||
key = Qt::Key_Meta;
|
||||
else if (key == Qt::Key_Meta)
|
||||
key = Qt::Key_Control;
|
||||
#endif
|
||||
|
||||
return static_cast<u32>(key) | (static_cast<u32>(modifiers) & static_cast<u32>(Qt::KeypadModifier));
|
||||
|
||||
@@ -147,6 +147,10 @@ bool ImGuiManager::Initialize()
|
||||
io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset | ImGuiBackendFlags_RendererHasTextures | ImGuiBackendFlags_HasGamepad;
|
||||
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard | ImGuiConfigFlags_NavEnableGamepad;
|
||||
io.KeyRepeatDelay = 0.5f;
|
||||
#ifdef __APPLE__
|
||||
// For macOS we should use the standard macOS text editing shortcuts
|
||||
io.ConfigMacOSXBehaviors = true;
|
||||
#endif
|
||||
|
||||
ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
|
||||
platform_io.Platform_GetClipboardTextFn = [](ImGuiContext* ctx) -> const char* {
|
||||
|
||||
Reference in New Issue
Block a user