better doc for key bindings?



Is there documentation for key bindings available somewhere?
this one is not very informative...
http://developer.gnome.org/doc/API/2.0/gtk/gtk-Bindings.html

I'm looking for a key binding bug and got some strange error
messages when I did the following for test:

GtkBindingSet *global_emacs_bindings;
...
gtk_rc_parse (PREFIX "/share/" GTKHTML_RELEASE_STRING "/keybindingsrc.emacs");
global_emacs_bindings = gtk_binding_set_find ("gtkhtml-bindings-emacs");
html_class->emacs_bindings = NULL;
...

I was a little surprised to find the following in binding_ht_lookup_entry :
  for (; entry; entry = entry->hash_next)
    if (entry->binding_set == set)
      return entry;
  return NULL;
--------------------------

The latter loop looks somewhat strange for me. Are collisions in hash tables
handled by the "application"...?
I simply don't understand what this search is for. "set" above is the same
set (global_emacs_bindings) as I have given as input. That search is
also what fails in my case, often works for first invocation of
editor, then not.

For me the obvious way to handle keys would be to have a linked set of
hash tables. Linked in the order of the widget inheritance which is using
them. Then when a key is found, lookup the command in a similar way.
So, the closest widget definition would always have preference. In the
way it is done now I simply don't understand how it works. Is this the
reason that e.g. Cntrl-P and such keys are stolen from the widget
where they are used in many cases?  (In some applications like
thunderbird I get a pop up window asking for printout when pressing
Cntrl-P instead of getting previous line etc...)

I get the feeling that key bindings as well as command association
lookups need to be redesigned in gtk. Please tell me I'm wrong, and
hint me to how it really works.

Best regards
Roland Orre



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