Re: key bind class




"Oskar Liljeblad" <osk@hem.passagen.se> writes:

> I'm working on a class that manages key events in a way different to
> accelerators. Instead of binding to a signal connected to an object, the
> application is notified through callbacks.
> 
> The class is part of an experimental command-based API for Gnome, where it
> crucial that key events are bound to callbacks. (Command-based applications
> allow the user to easily modify menus, toolbars and key bindings. Every menu
> item, toolbar and key binding is bound to a command with name, callback and
> some other properties.)
> 
> The class also takes care of multi-key sequences, and will handle parsing of
> key strings such as 'Ctrl+A A' or 'Ctrl+Shift+Tab'.
> 
> Since this class uses no Gnome-specific features, I'd like to ask if it this
> is stuff for GTK. It's not ready for inclusion yet, however it would be in a
> few days. If you want to know more about it, download
> http://hem.passagen.se/osk/gnome-commandapp-0.2.tar.gz and check the
> gnome-key* sources and the demo program, or email me.

You might want to look at:

  http://archive.redhat.com/gtk-list/1998-July/0525.html

That briefly summerizes the "binding" system for GTK+. 
The binding system is intended for doing things like
setting up keystroke bindings for Entry and Text widgets.

There is also, of course, the existing accelerator system,
which already allows runtime configuration of key bindings
for menu items. (Just press the key combination when the
entry is highlighted)

Neither of the systems allow multiple key sequences, of course,
and there is no builtin abstraction that would allow modifying
toolbars to activate menu items, so it isn't really exactly
what you are talking about with your commandapp. However,
there is enough overlap there that more comprehensive systems
should possibly be built on top of these facilities instead
of being put into GTK+ along side.

Regards,
                                        Owen



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