Share

Tk Toolkit

Tracker: Bugs

7 ctrl-v paste doesn't work on Linux - ID: 605277
Last Update: Comment added ( jenglish )

On Linux, I cannot use ctrl-V to paste text into a text widget
that I copied using ctrl-C or ctrl-X. It works fine on Win32.

Ctrl-C works. Ctrl-X works. Ctrl-V doesn't work.

This problem (on Linux) was there in 8.3.3 as well;
I upgraded to 8.4b2 ... problem still present.

For grins, here is the test script I used:

#! /usr/bin/wish -f

global GotSelection
set GotSelection 0

frame .fr -width 10c -height 5c ;#main window
wm title . "Simple Text Editor V 0"
pack .fr

#configure menubar on top
frame .menubar -relief raised -bd 2
pack .menubar -in .fr -fill x
frame .edf

#put a text widget with scroll bars

text .ed -width 80 -height 20 -bg grey \
-yscrollcommand ".ys set"

scrollbar .ys -command ".ed yview"
pack .ed .ys -in .edf -side left -fill y

pack .edf -in .fr -after .menubar -fill x


Dave Hein ( dthein ) - 2002-09-05 21:49

7

Closed

Fixed

Joe English

18. [text]

obsolete: 8.4.0

Public


Comments ( 5 )

Date: 2003-10-06 22:15
Sender: jenglish

Logged In: YES
user_id=68433

Patch committed now that SF CVS back up again.


Date: 2003-10-06 20:59
Sender: jenglish

Logged In: YES
user_id=68433

Surveyed tcl-core [1]; three of four respondents (all three
of whom are emacs users) agreed that ^V should be "paste"
and not "scroll down".

Jim Ingham (the fourth respondent) wrote: "Control-v should
continue to be scroll down on Mac OS & Mac OS X, since
Command-v is paste, and Control-v never has been paste..."

Updated patch moves Control-v binding into the Mac-specific
section.


[1] <URL:
http://aspn.activestate.com/ASPN/Mail/Message/tcl-core/1825281
>, "Tk Text widget: what should Control-V do?"



Date: 2003-10-03 01:53
Sender: jenglish

Logged In: YES
user_id=68433

Attached patch removes the ^V binding, and updates the
documentation to not mention ^V. Also adds a note that ^X
copies the selection to the clipboard before deleting it.
Did not add a description of ^C, since that would involve
renumbering all the .IP [NN] lines and I'm lazy.


Date: 2002-11-03 13:47
Sender: spboulet

Logged In: YES
user_id=6988

Thanks for the posting a fix; that's helpful.

There's still an issue with pasting, though. If you copy
some text and then select some text somewhere else,
<control> v doesn't replace the highlighted text, but adds
it to the right of the highlighted text.


Date: 2002-09-06 23:19
Sender: dthein

Logged In: YES
user_id=603528

I found the problem. But I don't know what the solution
should be.

The problem is that in text.tcl, Control-v is bound to some
sort of TextScrollPages operation. This binding is only
done on non-windows systems.

In tk.tcl, Control-Key-v is bound to the virtual event
<<Paste>>, which is what we want as default behavior for a
text widget.

If I comment out the binding code in text.tcl, then all
works as expected.

I suspect that this is just old code that wasn't purged out
from earlier versions of Tk ... for instance, there is no
Meta-v binding (as one would expect if using the emacs
"ctrl-v page forward, meta-v page backward" standard.

Anyway, I'm commenting out the binding on my system. I
think it would be good to remove that code segment in the
final release of 8.4.

Here's the code I'm talking about (from text.tcl) -- in
"commented out" form:

#if {[string compare $tcl_platform(platform) "windows"]} {
#bind Text <Control-v> {
# if {!$tk_strictMotif} {
# tk::TextScrollPages %W 1
# }
#}
#}





Attached Files ( 2 )

Filename Description Download
tk-text-paste.patch Patch to library/text.tcl, doc/text.n Download
tk-text-paste.patch Updated patch to library/text.tcl, doc/text.n Download

Changes ( 8 )

Field Old Value Date By
status_id Open 2003-10-06 22:15 jenglish
close_date - 2003-10-06 22:15 jenglish
resolution_id None 2003-10-06 22:15 jenglish
File Added 63615: tk-text-paste.patch 2003-10-06 20:59 jenglish
File Added 63266: tk-text-paste.patch 2003-10-03 01:53 jenglish
assigned_to hobbs 2003-10-03 01:17 jenglish
artifact_group_id obsolete: 8.4b2 2002-09-21 12:28 dthein
priority 5 2002-09-06 23:19 dthein