inkyblackness / imgui-go

Go wrapper library for "Dear ImGui" (https://github.com/ocornut/imgui)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

input text multiline: keyboard shortcuts

gucio321 opened this issue · comments

commented

Hi there!
I tried to copy the text from InputTextMultiline using Ctrl-C
but it doesn't work. I checked and DearImgui now supports keyboard shortcuts in text fields.

To reproduce

  1. clone imgui-go-examples
  2. go to cmd/example_glfw_opengl3
  3. run code go run -tags 'glfw' .
  4. open ImGui demo window
  5. navigate to widgets -> Text input -> Multiline text input
  6. select text and try to copy it using ctrl-c
  7. text isn't copied

Hello there!

Please help me out a bit as I cannot reproduce what you describe. In my cases, I could copy and paste text.

I tested on both MS Windows and Linux, and the behaviour is as follows:

  1. imgui-go-examples makes use of the clipboard functionality of the used platform. The first line of Run() in internal/example/Run.go registers a imgui.Clipboard compatible instance that links to the platform platform functions. (GLFW in your case).
    With this, I am able to copy/paste out of and into imgui-go-examples on both OS.

  2. When removing this registration, the default behaviour of Dear ImGui is used:
    On MS Windows, the native clipboard is used and text can be shared. On Linux, as per imgui.h documentation, an internal buffer is used and I can at least copy/paste within imgui-go-examples.

Which OS are you using? Does anything change if you remove the clipboard registration (point 2)? And, a wild idea: which keyboard language and layout are you using?

commented

@dertseha thanx for your reply.
I can't believe, but if I press Alt (exactly the left alt), the shortcuts starts to work 😕
reffering to your questions:
OS: Fedora 33; keyboard language: pl-PL

OK, I was using Debian (on WSL2).
When you write you pressed Alt - do you mean instead of Ctrl, or together, or perhaps in series?
Do you have any second system to cross-check with?

Addendum: Would you be able to cross-check the examples application with SDL as well? I'm wondering whether it is an issue with the modifier translation of the platform library.

commented

you are completely right!, it is fault of glfw. on sdl everything works fine.
So is it an issue of go-gl/glfw?

Possibly. To be sure you might want to cross check with glfw on another machine, and perhaps also cross check with the C++ glfw example from Dear ImGui.
It's difficult to pinpoint currently whether this is an issue with the OS, glfw (native library), glfw wrapper, or even the wrapper in imgui-go-examples (although unlikely at this point as it works on other matchines).
Yet, perhaps the people at glfw know better ways to find this out.

commented

okey, @dertseha thanks for help!