6

How do I add a new keyboard shortcut in GnuCash 2.6.15 in Windows (10)?

Specifically I would like to add a keyboard shortcut for the "Jump to corresponding transaction in the other account" function and map it to CTRL+j

Researching online I see there is mention of editing C:\Users\username\.gnucash\accelerator-map but I'm not sure of the details.

User
  • 3,835

3 Answers3

7

The file C:\Users\<your username>\AppData\Roaming\GnuCash\accelerator-map (in GnuCash 2 C:\Users\<your username>\.gnucash\accelerator-map) has about 260 lines which correspond to commands. E.g. to print:

; (gtk_accel_path "<Actions>/GncPluginPageRegisterActions/FilePrintAction" "<Primary>p")

While GnuCash was closed I opened the file and searched for the word jump. This took me to this line

; (gtk_accel_path "<Actions>/GncPluginPageRegisterActions/JumpTransactionAction" "")

The empty string at the end "" is where you put the keyboard shortcut. And you must also uncomment the line by removing the leading semicolon to activate the line.

I modified the above line to:

(gtk_accel_path "<Actions>/GncPluginPageRegisterActions/JumpTransactionAction" "<Primary>j")

<Primary> translates to "Command" on macs and "Ctrl" everywhere else. The other options are <Shift>, <Ctrl>, <Alt>, <Meta>. You can combine them as "<Shift><Alt>j"

Saved the file and then reopened Gnucash and my shortcut key was there.

The relevant documentation is here: https://wiki.gnucash.org/wiki/Keyboard_Shortcuts and this post was helpful: https://lists.gnucash.org/pipermail/gnucash-user/2014-December/057395.html

User
  • 3,835
1

Just a brief answer for GnuCash 3, which could be useful for others. The profile is located in GNC_DATA_HOME, which normally resolves to C:\Users\\AppData\Roaming\GnuCash.

The accelerators map is the same.

Source: https://wiki.gnucash.org/wiki/GTK3#Menu_Keyboard_Shortcuts

0

For users who like the portable version of GnuCash:

I found two files with the same name and it seems the first one does the trick:

installation-root\Data\GNCDataHome\accelerator-map

installation-root\App\Gnucash\share\gnucash\ui\accelerator-map

I did some simple tests with "edit account" which I often need to tweak (colors, custom currency) when setting up a system:

; (gtk_accel_path "<Actions>/GncPluginPageAccountTreeActions/EditEditAccountAction" "<Primary>e")

I learnt, that I have to stick to letters. <Primary># did not work.

note to self: remember to remove the initial ; to un-comment or no joy!

another note to self: While digging through the accelerator-map file, I noticed for the first time (after years of GnuCash use) that there is also a menu-entry called "Édition" (in French) which is somewhat similar to the right-click menu. But here some of the keyboard-shortcuts are displayed. Bingo.

final note, TL/DR: I am using the brand new version 5.0 in portable flavour for my tests today.