[SOLVED] SDL input problems

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

hurricane
Not too shy to talk
Not too shy to talk
Posts: 25
Joined: Fri Nov 28, 2008 11:59

[SOLVED] SDL input problems

Postby hurricane » Thu Feb 05, 2009 16:40

Hi,

i try find some solutions in the old topics but nothing...

For the input injection in CEGUI i use the tutorial in the wiki so the code is this (for the key up and down):

Code: Select all

      case SDL_KEYDOWN:
        // to tell CEGUI that a key was pressed, we inject the scancode.
        CEGUI::System::getSingleton().injectKeyDown(e.key.keysym.scancode);
       
        // as for the character it's a litte more complicated. we'll use for translated unicode value.
        // this is described in more detail below.
        if ((e.key.keysym.unicode != 0)
        {
          CEGUI::System::getSingleton().injectChar(e.key.keysym.unicode);
        }
        break;
   
      // key up
      case SDL_KEYUP:
        // like before we inject the scancode directly.
        CEGUI::System::getSingleton().injectKeyUp(e.key.keysym.scancode);
        break;



But i have this problems:

1) the DEL key don't work
2) the arrows keys (UP,DOWN,LEFT,RIGHT) don't work

ps i am testing this inputs in a default cegui editbox

What is the problem?

thanks

Martin
Last edited by hurricane on Thu Feb 05, 2009 19:35, edited 1 time in total.

hurricane
Not too shy to talk
Not too shy to talk
Posts: 25
Joined: Fri Nov 28, 2008 11:59

Postby hurricane » Thu Feb 05, 2009 19:34

woooooow

i solved this problem with this key-conversion-table:

http://www.cegui.org.uk/wiki/index.php/ ... I_keytable

ps the tutorial say that in windows the keys value (SDL -> CEGUI) are tha same but i had this problems...

thanks, bye

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Fri Feb 06, 2009 09:29

Hi.

can you link to the tutorial that incorrectly says the SDL scan codes are the same as CEGUI ones, so we can perhaps fix it (I'm not sure which one you mean :) ).

Thanks,

CE.

hurricane
Not too shy to talk
Not too shy to talk
Posts: 25
Joined: Fri Nov 28, 2008 11:59

Postby hurricane » Fri Feb 06, 2009 09:48

CrazyEddie wrote:Hi.

can you link to the tutorial that incorrectly says the SDL scan codes are the same as CEGUI ones, so we can perhaps fix it (I'm not sure which one you mean :) ).

Thanks,

CE.


http://www.cegui.org.uk/wiki/index.php/ ... ting_Input

you say:

Luckily the key code is just the SDL scancode, so we inject that directly. (This only seems to be true on windows. On other platforms you will need to use a translation function. One can be found here SDL to CEGUI keytable)


i am in windows but i must use a translation function :(

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Fri Feb 06, 2009 12:12

Hi,

Thanks for pointing us to the offending Wiki article.

I guess it's possible that when that article was originally written, no translation was required, but subsequently a translation became necessary.

CE.


Return to “Help”

Who is online

Users browsing this forum: Baidu [Spider] and 25 guests