Gnome Developers' Information
<<< Previous | Automatic menu and toolbar creation with GnomeAppHelper | Next >>>

# Format information for the configuration of keybindings for standard mens

The information about keybindings is stored using gnome-config. It's stored in the section "/Gnome/Menus". Each keybinding is two key/value pairs. We'll assume that the menu item is new. The idea extends. The first key pair, in this case, is Menu-new-accelerator-key. The value is an integer (I believe from gtk+/gdk/gdkkeysyms.h) describing which key corresponds to this menu item. The second key is Menu-new-ac-mods. This value is another integer, describing which set of modifiers corresponds to this menu item. This value is a logical or of values in GdkModifierType in gtk+/gdk/gdktypes.h.

If building the configuration by hand, you need to edit ~/.gnome/Gnome. You need to add a section headed by [Menus]. It should contain two lines for each menu item. Again suppose that you're configuring the menu item new. The first line of the pair should read "Menu-new-accelerator-key=<number>" where <number> is an integer from gtk+/gdk/gdkkeysyms.h. Usually this means that it's an ASCII value describing which key corresponds to this menu item. The second line should read "Menu-new-ac-mods=<number>" where <number> is a logical or of values from GdkModifierType in gtk+/gdk/gdktypes.h. Usually, this means to start with 0. If you want shift to be part of the keybinding, add 1. If you want control to be part of the keybinding add 4. If you want alt to be part of the keybinding, add 8. The result is the value substituted for <number> in the second line of the pair.

The list of possible menu items is as follows.

- new

- open

- save

- save-as

- revert

- print

- print-setup

- close

- exit

- cut

- copy

- paste

- clear

- undo

- redo

- find

- find-again

- replace

- properties

- preferences

- about

- select-all

- new-window

- close-window

- new-game

- pause-game

- restart-game

- undo-move

- redo-move

- hint

- scores

- end-game

<<< Previous | Home | Next >>>
Convenience macros to fill GnomeUIInfo structures | Up | Functions provided by GnomeAppHelper