[Vala] grabbing keyboard focus with GtkClutterEmbed



Hello

This is probably more of a Gtk question than a Clutter question. I
have a GtkClutter.Embed in my application, which has an actor that
responds to keyboard events from every key (it's a text view). The
problem is that when I press the arrow keys, the focus changes from
the actor to the surrounding widgets, when really I want the actor to
handle the arrow key presses to move the cursor.

I have:

embed.button_release_event.connect (() => {
    embed.grab_focus ();
    return false;
});

which activates the stage, then:

this.button_release_event.connect (this.button_release); // Which
calls this.grab_key_focus () in the callback
this.key_press_event.connect (this.key_press); // This callback works
fine until I press one of the arrow keys


Cheers
James



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]