&appname; has several shortcut keys or key combinations for commands as listed in the main window along side the command.
</para>
<para>
-Some function keys follow standard GUI behaviour:
+By default some function keys follow standard GUI behaviour:
</para>
<itemizedlist>
<listitem><para><keycap>F1</keycap> Help (view this manual)</para></listitem>
<listitem><para><keycap>Ctrl+Left</keycap> Pan the viewport West</para></listitem>
<listitem><para><keycap>Ctrl+Keypad+</keycap> Zoom In</para></listitem>
<listitem><para><keycap>Ctrl+Keypad-</keycap> Zoom Out</para></listitem>
-<listitem><note><para>These work irrespective of the <xref linkend="tools"/> mode selected</para></note></listitem>
</itemizedlist>
+<important><para>These work irrespective of the <xref linkend="tools"/> mode selected</para></important>
For other combinations see the menu entry themselves.
</para>
</section>
+<section>
+<title>Keyboard Configuration</title>
+<para>Keyboard configuration is supported by the standard GTK+ way of changing shortcuts for menu entries.</para>
+<para>Hover over the menu option with the mouse pointer and press the keyboard shortcut you want to bind it to.</para>
+<para>To delete a keyboard assignment, press <keycap>Backspace</keycap> whilst over the menu entry.</para>
+<note>
+<para>
+ If the keyboard shortcut is already in use you will not receive any notification that new action replaces the old action.
+ This is probably why most distributions have this facility disabled by default.
+ Thus you will need to enable <emphasis>Editable menu accelerators</emphasis> for your system.
+ Check the Desktop Menu and Toolbar Control or other User Interface preferences for this setting.
+</para>
+</note>
+<note>
+<para>
+ For Windows systems this can be done by adding the line <emphasis>gtk-can-change-accels=1</emphasis> to <filename>%USERPROFILE%\.gtkrc-2.0</filename> (create the file if it does not exist).
+</para>
+</note>
+<para>From &app; 1.6+ the keyboard configuration is automatically loaded and saved between sessions in the <xref linkend="config_keys"/></para>
+</section>
+
<section><title>Tracks vs Routes</title>
<para>
In theory a route is path you are planning to follow and a track of where you have actually been. The GPX specification splits these into two separate catergories, although tracks contain everything route may have.
</variablelist>
</para>
</section>
+
</section>
+ <section id="config_keys" xreflabel="Keyboard Shortcuts File">
+ <title>Keyboard Shortcuts (Accelerator) Settings</title>
+ <para>This is held in the file <filename>~/.viking/keys.rc</filename></para>
+ <para>It is in the standard GTK Accelerator map format. Values are automatically read in and saved between &app; sessions.</para>
+ <para>This file is not intended to be manually edited, but since it is a plain text file it can be changed if desired.</para>
+ </section>
+
</section>
<!-- End of Extending Viking -->
#include "vikmapslayer.h"
#include "geonamessearch.h"
#include "vikutils.h"
+#include "dir.h"
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#define VIK_SETTINGS_WIN_SAVE_IMAGE_PNG "window_save_image_as_png"
#define VIK_SETTINGS_WIN_COPY_CENTRE_FULL_FORMAT "window_copy_centre_full_format"
+#define VIKING_ACCELERATOR_KEY_FILE "keys.rc"
+
static void vik_window_init ( VikWindow *vw )
{
vw->action_group = NULL;
// Set the default tool + mode
gtk_action_activate ( gtk_action_group_get_action ( vw->action_group, "Pan" ) );
gtk_action_activate ( gtk_action_group_get_action ( vw->action_group, "ModeMercator" ) );
+
+ gchar *accel_file_name = g_build_filename ( a_get_viking_dir(), VIKING_ACCELERATOR_KEY_FILE, NULL );
+ gtk_accel_map_load ( accel_file_name );
+ g_free ( accel_file_name );
}
static VikWindow *window_new ()
a_settings_set_integer ( VIK_SETTINGS_WIN_SAVE_IMAGE_WIDTH, vw->draw_image_width );
a_settings_set_integer ( VIK_SETTINGS_WIN_SAVE_IMAGE_HEIGHT, vw->draw_image_height );
a_settings_set_boolean ( VIK_SETTINGS_WIN_SAVE_IMAGE_PNG, vw->draw_image_save_as_png );
+
+ gchar *accel_file_name = g_build_filename ( a_get_viking_dir(), VIKING_ACCELERATOR_KEY_FILE, NULL );
+ gtk_accel_map_save ( accel_file_name );
+ g_free ( accel_file_name );
}
return FALSE;