Selecting a string to paste over
Bernd Gehrmann
bernd at physik.hu-berlin.de
Thu Aug 5 23:07:40 BST 1999
On Thu, 05 Aug 1999 holle at almaden.ibm.com wrote:
>Now here comes the interesting part. If you just select the text in e.g. an
>xterm and want to past it into one of the following programs: Netscape (using
>Meta-V), any Java-Swing Program (using Ctrl-V) or Emacs (using Ctrl-y) you will
>get nothing (maybe a beep). I checked the Swing docs and they actually say that
>X11 has *two* Clipboards. A primary and a secondary - oops ???
>From the Emacs documentation:
----------
In the X window system, mouse selections provide a simple mechanism
for text transfer between different applications. In a typical X
application, you can select text by pressing the left mouse button and
dragging the cursor over the text you want to copy. The text becomes
the primary X selection and is highlighted. The highlighted region is
also the Emacs selected region.
* Since the region is the primary X selection, you can go to a
different X application and click the middle mouse button: the
text that you selected in the previous application is pasted into
the current application.
...
There are other kinds of X selections besides the Primary selection;
one common one is the Clipboard selection. Some applications prefer to
transfer data using this selection in preference to the Primary. One
can transfer text from the Primary selection to the Clipboard
selection with the Copy command under the Edit menu in the menubar.
Usually, the clipboard selection is not visible. However, if you
run the `xclipboard' application, the text most recently copied to the
clipboard (with the Copy command) is displayed in a window. Any time
new text is thus copied, the `xclipboard' application makes a copy of
it and displays it in its window. The value of the clipboard can
survive the lifetime of the running Emacs process. The `xclipboard'
man page provides more details.
----------
Qt doesn't know anything about the so-called'Clipboard' selection
(used e. g. by Motif programs). The QClipboard class represents
the primary selection. If you click the middle mouse button, the
selection is pasted; if you use the left mouse button to mark a
text, it is automatically copied into the selection. So if an
application uses QClipboard to implement Cut, Copy, Paste, it's
unavoidable that there is a collision (at least on X11; on Windows,
Qt does not automatically copy marked text into the clipboard ;-(
Bernd.
More information about the KDevelop
mailing list