Re: Really global accelerators ?



On 10/16/01 Pedro Caria wrote:
I can't seem to find a way to have an accelerator that works all the
time...
My problem: I want to use ctrl-w to activate something in my program,
but if the focus is in a GtkEntry, ctrl-w is bound to kill word... is
there any way around this ?

I have tried attach accels to the GtkEntry, tried changing the bindings
in gtkrc, tried shuting off the signals in the GtkEntry... nothing seems
to work...

A key event is first sent to the toplevel window: you should be able to
handle it there, if that doesn't work, your code doesn't do the right
things.
Anyway, there is also another way to get keyboard events before Gtk
sends them to the widgets:

        Gtk->key_snooper_install (\&handler);

with:
sub handler {
        my ($widget, $gdkevent, @args) = @_;
        #return 1; # if we want to handle the key event ourselves
        return 0;
}

lupus

-- 
-----------------------------------------------------------------
lupus debian org                                     debian/rules
lupus ximian com                             Monkeys do it better



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