Focus is not working for me

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

leonardoalt
Just popping in
Just popping in
Posts: 15
Joined: Thu Nov 06, 2008 18:44

Focus is not working for me

Postby leonardoalt » Tue Mar 17, 2009 01:18

I want to add keyboard input to my Menu. Mouse input is working great.
I did w->activate() when something i decided happens, but it didn't get the "effect" (focus) that it gets when the mouse is over it.
Any ideia of what i need to do?

Thanks.

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

Postby CrazyEddie » Tue Mar 17, 2009 11:30

Hi,

Perhaps the input is actually ending up with a child window of 'w'? You could try w->getActiveChild and deactivate it, or something? Though having said that, it's probably not really what you want to be doing.

CE

leonardoalt
Just popping in
Just popping in
Posts: 15
Joined: Thu Nov 06, 2008 18:44

Postby leonardoalt » Tue Mar 17, 2009 16:42

W, in this case is a PushButton.
In the method, i got the WindowManager*, and from it, got the button i wanted:
Window* w = WMngr->getWindow("ContinueButton");
w->activate();

leonardoalt
Just popping in
Just popping in
Posts: 15
Joined: Thu Nov 06, 2008 18:44

Postby leonardoalt » Wed Mar 18, 2009 00:24

I don't know if it helps, but i tryed the methods "hide()" and "setEnabled(false)" instead of "activate()", and both worked, only "activate()" didn't.

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

Postby CrazyEddie » Wed Mar 18, 2009 09:31

I think I misunderstood, in my first response.

In order to get the 'hover' effect currently requires that the mouse be over the button. What this means is that when implementing a keyboard interface you basically have to move the mouse around programmatically to achieve these effects; there is no other way to do this currently, which means if you want your keyboard interface and the user to have control of the mouse, you'll end up rewriting sections of CEGUI.

CE.

leonardoalt
Just popping in
Just popping in
Posts: 15
Joined: Thu Nov 06, 2008 18:44

Postby leonardoalt » Fri Mar 20, 2009 00:05

Hmmmm, i understood.
Thanks for the informations, CE.

Best regards, Leonardo.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 3 guests