Page 1 of 1
Editbox: how to insert special characters?
Posted: Wed Jul 08, 2009 09:00
by djphilipe
Hi,
how I insert special characters into editbox by classic keyboard?
I tried to insert into editbox characters such as ' š ', ' č ', etc...(Slovak chars) but it doesn't work.
I have set Slovak keyboard of course.
But if I set text by method it work.
Code: Select all
pEditBox->setText(reinterpret_cast<const utf8*>("ščť"));
Thanks
Re: Editbox: how to insert special characters?
Posted: Wed Jul 08, 2009 09:27
by CrazyEddie
This is really a question to ask of your chosen input library. CEGUI will respond to whichever codes (as UTF32 code points) you inject into it. I am aware of some issues with regards to injecting of multiple codepoints which are supposed to be combined to form a single glyph, in these cases that combination must be currently be detected and processed prior to injecting into CEGUI - so that CEGUI gets the final code of the glyph you want rendered.
HTH
CE.
Re: Editbox: how to insert special characters?
Posted: Thu Jul 09, 2009 06:51
by djphilipe
I use Ogre and input library is probably OIS. The problem will be in OIS?
Filip
Re: Editbox: how to insert special characters?
Posted: Thu Jul 09, 2009 08:53
by CrazyEddie
Well, maybe 'problem' is not the right word, since OIS does what it does pretty well. But if you're using OIS as your sole source of character inputs, then if OIS does not supply the codes needed - depending on the exact nature of the issue (basically, you're not seeing what you want, but what are you seeing instead?) there may be a way around it. If you're getting nothing from OIS then I would say it's an OIS issue, if you're getting a sequence of glyphs instead of a single glyph, then it's more complicated and you may need an additional intermediary step to translate the sequence to a single glyph.
CE.
Re: Editbox: how to insert special characters?
Posted: Thu Jul 09, 2009 11:43
by djphilipe
I have studied OIS lightly.
OIS returns OIS:KeyEvent and text(unsigned int) in keyPressed. But text is only Ascii code. And we need unicode.
Solution is use of other input library or modification of OIS.
Thanks
Filip
Re: Editbox: how to insert special characters?
Posted: Fri Jul 10, 2009 04:51
by Speedo
If you get the latest OIS from CVS/SVN (whichever they use, I forget) it supports unicode input. I don't know why they haven't put out a new release so people will know where to get unicode support, but anyway. /shrug