Mapping copy and paste to function keys in Windows

John Ralls jralls at ceridwen.us
Mon Jan 26 12:33:43 EST 2015


> On Jan 25, 2015, at 11:16 PM, Chris Good <chris.good at ozemail.com.au> wrote:
> 
> Hi GnuCash users,
> 
> 
> 
> Windows 7, GnuCash 2.6.2
> 
> 
> 
> Just a question, no biggie. Just trying to make my GC experience even better
> than it already is.
> 
> 
> 
> I find when entering transactions in the register, I often copy and paste
> amounts using Control-C and Control-V and thought it would be much faster if
> I could use, say:
> 
> F11 as copy and F12 to paste.
> 
> 
> 
> Ideally it would be nice to have a function key that also selected the
> current field, and copied it but that would just be gravy.
> 
> 
> 
> http://wiki.gnucash.org/wiki/Keyboard_Shortcuts says it is possible to remap
> hotkeys.
> 
> 
> 
> So I tried modifiying C:\Users\[USERNAME]\.gnucash\accelerator-map changing
> (while GnuCash not running)
> 
> 
> 
> ; (gtk_accel_path "<Actions>/MainWindowActions/EditCopyAction" "<Primary>c")
> 
> ; (gtk_accel_path "<Actions>/MainWindowActions/EditPasteAction"
> "<Primary>v")
> 
> 
> 
> to:
> 
> 
> 
> (gtk_accel_path "<Actions>/MainWindowActions/EditCopyAction" "F11")
> 
> (gtk_accel_path "<Actions>/MainWindowActions/EditPasteAction" "F12")
> 
> 
> 
> I see in accelerators-map that help is defined as F1 so I hoped F11 and F12
> should work.
> 
> 
> 
> It doesn't work. Ctrl-C & Ctrl-V still work as before and Copy and Paste
> still show as Ctrl-C and Ctrl-V in the Edit menu.
> 
> 
> 
> I found a couple of references in google that more or less seem to say it
> won't work.
> 
> 
> 
> http://gnucash.1415818.n4.nabble.com/Re-Re-Keyboard-Shortcuts-td4674640.html
> 
> https://bugzilla.gnome.org/show_bug.cgi?id=726483
> 
> 
> 
> Does anyone please know how to do what I want?
> 
> If it is not possible, I'd like to update the wiki (if I'm allowed) but I'm
> not sure what I'd say at the moment, other than this doesn't seem to work on
> Windows in versions 2.6+.
> 
> 
> 
> I haven't tried, but could this work in Linux or does it not work in all
> platforms from 2.6?
> 
> 
> 
> Maybe there is a better way for me to enter transactions which wouldn't
> require copying and pasting amounts so much?
> 
> I tend always be in transaction journal mode (all splits show) and to
> 'duplicate' just about all the transactions I enter, so that all splits are
> copied into the new transaction.
> 
> I.e. I 'find' transactions with a unique word in the description, then
> duplicate one of them.
> 
> If I just type the description into a blank transaction, it brings up the
> last transaction as expected but doesn't add the other splits from the last
> transaction, so I find it faster to find, then duplicate.

If you fiddle around a bit you'll find that your new accelerators work in the place where the Edit>Copy and Edit>Paste menu items apply and not in other places. The reason for that is that Gtk splits the handling of keyboard shortcuts into two categories, accelerators (for menu items) and bindings (for individual widgets like the text-entry widget). You modified the accelerators but not the bindings. 

I've updated http://wiki.gnucash.org/wiki/Keyboard_Shortcuts#Modifying_Keyboard_Shortcuts with instructions for modifying bindings.

Regards,
John Ralls




More information about the gnucash-user mailing list