#17 add Control-c binding to copy selected text to clipboard

open
nobody
5
2006-03-27
2006-03-27
Oliver Fitz
No

TkDiff 4.1.3:

The "copy to clipboard" function is already available,
but the key-binding is missing. I patched it myself in
our local version by inserting:

bind $widget <Control-c> "
do-copy
break
"

above the already existing:

bind $widget <c> "
center
break
"

Perhaps one of the maintainers could add this to the
next version. I'm on Windows here and it just seems
natural to have this.

Thanks,
Oliver

Discussion

  • Gary Lowther
    Gary Lowther
    2007-09-19

    Logged In: YES
    user_id=992029
    Originator: NO

    I'd like to cast a vote for this feature, too! In addition, since "Copy" is such a commonly needed/used function, I'd like to see it added to the context menu. I did this for my team's use via the following code change in "proc build-popupMenu {}":

    $m add command -label "Copy" -underline 0 -command do-copy -accelerator "c"
    $m add separator

    I inserted this immediately after the menu was instantiated (e.g. right after line
    "set m $w(popupMenu)"), making it the first item in the context menu, and therefore, very easy/quick to select.

    Although I haven't coded these up (yet), I'd also like to see a couple of additional copy functions. Specifically, "Copy Line" would be nice, and "Copy Section" would be even nicer. The former would simply search for beginning/end of line, and copy everything in it to the clipboard. The latter might search for the first blank line above the insertion pointer, and the first blank line after the pointer, and copy everything in between to the clipboard.