Input under Linux

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Durin
Just popping in
Just popping in
Posts: 17
Joined: Tue May 15, 2007 10:15

Input under Linux

Postby Durin » Thu Jul 05, 2007 09:52

The problem is that Cegui´s Inputsystem works fine under Windows, but under Linux special letters as ö, ä and ü (german language) are not accepted as input in an editbox. The System just does nothing if this key is pressed. Under Windows it works fine so far.
Thx for help

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Postby Pompei2 » Thu Jul 05, 2007 10:39

If you are using SDL, I solved the same problem a few weeks ago. Do you use the SDL ?

Durin
Just popping in
Just popping in
Posts: 17
Joined: Tue May 15, 2007 10:15

Postby Durin » Thu Jul 05, 2007 16:57

I`m not using SDL. I use only the methods
CEGUI::System::getSingleton().injectKeyUp(evt.key),
CEGUI::System::getSingleton().injectKeyDown(evt.key) and
CEGUI::System::getSingleton().injectChar(evt.text);

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Postby Pompei2 » Thu Jul 05, 2007 18:15

Hmm, then it's probably your injectChar that is not called correctly. I guess the evt variable comes from the X-lib events ? I don't know much about this, but you need the X-lib to give you a unicode character. That means you need a function that:

if the hat sign ^ is pressed once, returns you 0 or NULL or whatever. so if this function returns that value, you skip the injectChar function call.

if after pressing the ^ key, the "e" key is pressed, the function has to return you the unicode (UTF8, i guess) value of "ê", so you pass it to injectChar.

Unfortunately I don't know X-lib very good. I think i saw such a function once, i'll go look for it this evening :)

Durin
Just popping in
Just popping in
Posts: 17
Joined: Tue May 15, 2007 10:15

Postby Durin » Fri Jul 06, 2007 10:55

I don't know X-lib at all. But if you could find this function to solve the problem and post it, it would make me happy ;-).

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Postby Pompei2 » Fri Jul 06, 2007 11:17

I'm really sorry, it is not the function. The function I had in my head (XKeysymToString) transforms it into a complete string, like "space".

Here is all I know, maybe it will help you in your search, maybe not:

Code: Select all

void eventCallback( XPointer /*priv*/, XRecordInterceptData *d )
{
   unsigned int detail = (((unsigned char *)d->data)[1]);

   // Gets you the keysym of the key that was pressed, I think
   // You will need the keysym to get the unicode keycode.
   XKeycodeToKeysym(pDisplay,detail,0);
}


But you are using the X-lib right ? I see you write your program for both windows and linux, so why don't you use the SDL ?

Durin
Just popping in
Just popping in
Posts: 17
Joined: Tue May 15, 2007 10:15

Postby Durin » Fri Jul 06, 2007 22:08

I solved the problem in another way. I added the functionality manually in my own inputhandler. It´s not very fine but i think it works. I have to test it (because i didn`t have a Linux system), but i hope it works.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 20 guests