cinder / Cinder

Cinder is a community-developed, free and open source library for professional-quality creative coding in C++.

Home Page:http://libcinder.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Text input does not support modifier keys other than Alt,Ctrl,Shift,Meta on linux.

godefv opened this issue · comments

I am using the UK extended keyboard layout. So, for example, typing ` then a writes à, typing AltGr+6 then a writes â.
I am also using the compose key. So for example, typing Compose then o then e writes œ.
See https://en.wikipedia.org/wiki/Modifier_key#Accented_characters .

None of these examples work on the TexBox sample, only the unmodified keys are taken into account. Some debugging seems to show that the modifier keys like accents and compose are not implemented. I guess it should be around this file src/cinder/app/linux/AppImplLinuxGlfw.cpp, maybe in extractKeyModifiers() and modifyChar() ?

I volunteer to contribute if needed.

I have a somewhat related issue. My (custom) solution in one application -- in order to use an ImGui text input widget in Cinder -- is to register my own key down handler (with higher priority than the ImGui key down handler) and have it detect the special key combinations for my (Spanish) keyboard, which use the AltGr key (this is equivalent to Alt+Ctrl+something). It then remaps to the appropriate char and "injects" it to ImGui. This is not for accented characters, in my case, but required just to type regular ASCII things like []{}@#\ etc., that require AltGr on a Spanish keyboard (which, incidentally, is pretty annoying for programming 😉).

Anyhow, this is not a general solution to your problem (or mine), but does illustrate a related "non-US" keyboard issue.

Oh, I see, the French keyboards are similar. So, this is a more serious issue than I thought.
Thanks for your input !