Re: Question about the new GTK+ 2 keyboard navigation



Yao Zhang <yzhang sharemedia com> wrote:
> Hi,
> 
> I have a question about the recent change in GTK+ 2 keyboard navigation.
> 
> In the current GTK+2 CVS, the mnemonics and shortcuts are processed
> first.  The widget with the focus may never see those keyboard events.
> This may not be a problem with text widget which mainly uses mouse.
> But for a text widget like VIM editor window, there maybe Ctrl+ or
> Alt+ keys defined for the editing command.
> 
> Is there a way to disable the mnemonics and shortcuts processing for a
> particular text widget?

The way we deal with this in ROX-Filer is to do add_accel_group,
accel_groups_activate and then remove_accel_group in the key event handler
each time a key is pressed.

(This is because we have a pop-up minibuffer. When it's open Ctrl+C should
copy the text selection, but when closed Ctrl+C should copy a file, etc.)

I'm not sure this is the best way to do it, though. Also, be careful that
you don't call remove_accel_group if the window is destroyed in the
activate step...


-- 
Thomas Leonard			http://rox.sourceforge.net
tal00r ecs soton ac uk		tal197 users sourceforge net



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