Mapping copy and paste to function keys in Windows

Chris Good chris.good at ozemail.com.au
Fri Feb 13 18:45:10 EST 2015


Hi John,

Works like a dream thanks, and Control-C and Control-V also still work as I
didn't unbind them.

To document for other users, as well as mods below to accelerator-map:

Create file .gtkrc-2.0 in home directory (Ie C:\Users\cgood\.gtkrc-2.0)
containing:

binding "gtk-alt-edit"
{
  bind "F11" { "copy-clipboard" () }
  bind "F12" { "paste-clipboard" () }
}

class "GtkWidget" binding "gtk-alt-edit"

Regards, Chris Good

> -----Original Message-----
> From: John Ralls [mailto:jralls at ceridwen.us]
> Sent: Tuesday, 27 January 2015 4:34 AM
> To: Chris Good
> Cc: gnucash-user at gnucash.org
> Subject: Re: Mapping copy and paste to function keys in Windows
> 
> > 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?
> >
> 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_Sh
> ortcuts with instructions for modifying bindings.
> 
> Regards,
> John Ralls
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 6091 bytes
Desc: not available
URL: <http://lists.gnucash.org/pipermail/gnucash-user/attachments/20150214/9b8db207/attachment.p7s>


More information about the gnucash-user mailing list