LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Copy/Paste implementation (https://www.linuxquestions.org/questions/linux-newbie-8/copy-paste-implementation-384938/)

jrdioko 11-20-2005 03:04 PM

Copy/Paste implementation
 
I've been using Linux for quite some time now, and I think I understand the working of "copy and paste" in various settings, but I'm curious what exactly controls this. In other words, I assume the Vi and Emacs versions are self-contained within those editors, but what about selecting and pasting text in other X windows in general? in a terminal outside of X?

Tinkster 11-20-2005 03:23 PM

Copy & paste in X is controlled by a) either X itself or
b) the WM/DE you're using. Most commonly you will be
able to highlight text with mb1-down/highlight/mb1-up and
paste it with mb2-click.

In the console you can use a similar method if gpm is
running and configured.

If these aren't the answers you're after I have completely
misunderstood your question ;}


Cheers,
Tink

jrdioko 11-20-2005 03:26 PM

That's exactly it, thanks! So in Fluxbox, for example, is it X that's actually keeping track of that mouse-down, mouse-up pattern? Do different WM/DEs handle it any differently?

Tinkster 11-20-2005 03:50 PM

Yes, it's X. DEs/WMs COULD override it, however I have no
idea which ones are using which mechanism.


Cheers,
Tink

jrdioko 11-20-2005 05:57 PM

Interesting, thanks again.

foo_bar_foo 11-20-2005 09:55 PM

x has 3 clipboard type things and their interaction can be kind of strange
first highlight middle click thing is "primary selection"
second is called "clipboard selection" and exists within apps and is not overridden by primary selection
so for instance you highlight something (text1) in a qtextedit widget
as soon as you highlight it is becomes "primary selection"
you can paste it around with the middle click button but the "paste" command in the menu does not paste it unless it is selected in a "copy" (text2) from the menu and things selected and copied from the menu
"clipboard selection" will continus to be pasted with the "paste" menu command even though the
"primary selection" or whats being pasted from the middle click button changes by selecting something else.
The third "Secondary selection" another layer clipboard is also available in X but rarely used


All times are GMT -5. The time now is 06:25 PM.