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.