isadorasophia / murder

Murder is a pixel art ECS game engine.

Home Page:https://isadorasophia.com/murder/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implement ImGui ctrl-c/ctrl-v for Linux

isadorasophia opened this issue · comments

ImGui does not support clipboard by default in Linux and Mac. We already implemented Mac scenario, see this line:

private void InitializeImGui()
{
    // Magic so ctrl+c and ctrl+v work in mac!
    if (OperatingSystem.IsMacOS())
    {
        ImGuiIOPtr io = ImGui.GetIO();

        if (OperatingSystemHelpers.GetFnPtr is IntPtr getFnPtr)
        {
            io.GetClipboardTextFn = getFnPtr;
        }

        if (OperatingSystemHelpers.SetFnPtr is IntPtr setFnPtr)
        {
            io.SetClipboardTextFn = setFnPtr;
        }
    }
}

We should implement such that OperatingSystemHelpers also supports Linux.