[Sugar-devel] Quick question - gtk focusing

Wade Brainerd wadetb at gmail.com
Wed Mar 4 13:51:47 EST 2009


Hey Emiliano,
It depends on what value you return from your key_press_event handler.

If you return False (the default), the event is passed on to other event
handlers including the keyboard navigation one.
If you return True, no other event handlers will be processed so keyboard
navigation will be avoided.

-Wade

On Wed, Mar 4, 2009 at 11:22 AM, Emiliano Pastorino <
epastorino at plan.ceibal.edu.uy> wrote:

> Hi everyone!
>
> I'm writing an activity that uses left, right, up and down keys
> and four buttons which I want to associate to a key_press_event.
> My problem is that when you press the up arrow a few times,
> you get focus on the activity toolbar, and then if you press left or
> right, you get focus through the activity toolbar buttons.
>
> I've tried grab_focus() when you press a key, but I'm still getting
> focus on the activity toolbar for an instant. I've seen that some
> activities never get focus on the activity toolbar when you press
> the arrow keys, but I couldn't find where to set that behaviour.
>
> Also, related to this, I want to have a button associated to a
> key_press_event when "Enter" is pressed, but when you press
> "Enter", it simulates a click on the button which has focus, and
> that causes a funny behaviour when you already have focus on
> the corresponding button.
>
> Summarizing... I need not to focus ever on any button, is that
> possible? I'm using gtk.Button only...
>
> Thanks!
>
> --
> Ing. Emiliano Pastorino
> LATU - Plan Ceibal
> Av. Italia 6201 CP: 11500, Montevideo, Uruguay
> Tel: (598 2) 601 5773 int.: 210
>
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.sugarlabs.org/archive/sugar-devel/attachments/20090304/5018bd1b/attachment-0001.htm 


More information about the Sugar-devel mailing list