Date: Mon, 04 Oct 2004 12:26:42 +0200 (CEST) Message-Id: <20041004.122642.59485931.oandrieu at nerim.net> To: zack at bononia.it Cc: lablgtk at kaba.or.jp Subject: Re: overriding text view keyboard shortcut From: Olivier Andrieu In-Reply-To: <20041004092801.GA5587 at fistandantilus.takhisis.org> References: <20041004092801.GA5587 at fistandantilus.takhisis.org> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit > Stefano Zacchiroli [Mon, 4 Oct 2004]: > I'm using GText view/buffer widgets for console like user input in a > lablgtk2 ocaml application. I would like to have the usual emacs > keybinding c-f,c-b,c-p,... Thus I've wrapped my text view widget inside > an event box which handle the corrispoding events. > > Unfortunately, c-a is already handled by the text view widget as a > shortcut for the select-all event and the signal does not reach the > enclosing event box. > > Is there a way to remove the c-a binding for the text view widget so > that my event box could handle it? Woah, using an EventBox is probably not the right way to do this. Widgets key bindings can be customized via resource files (gtkrc files), cf. the documentation on rc files : http://developer.gnome.org/doc/API/2.0/gtk/gtk-Resource-Files.html LablGTK doesn't wrap many of these functions, only GtkMain.Rc.add_default_file I think, but it should be enough to do what you want. GTK2 ships with a Emacs keybindings set, it is in /usr/share/themes/Emacs/gtk-2.0-key/gtkrc for me. -- Olivier