且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

C ++在Linux上从剪贴板获取字符串

更新时间:2023-11-14 23:26:04

您尝试不是首先查找代码,而是找到具有实现的程序吗?我为您做了,发现了很多使用直接X11调用的实现.我认为最有价值的是.只需找到任何程序,然后查找源即可.尝试在Wikipedia上查看哪些应用程序使用x11剪贴板/选择系统.

Did you try to find not a code first but a program with an implementation ? I did it for you and found a lot of implementations which use direct X11 calls. I think the most valuable is this but also you may read this. Just find any program and look for the sources. Try to look on wikipedia what applications use x11 clipboard/selection system.

以下程序专门用于数据传输 机制:

The following programs specifically operate on data transfer mechanisms:

xcutsel将数据从选择内容传输到剪切缓冲区,反之亦然

xcutsel transfers data from selections to cut buffers or vice versa

xclipboardglipper(Gnome),parcellite(LXDE)和klipper(KDE)是 剪贴板管理器,也许wmcliphist以及xcb也会显示 剪切缓冲区,并允许用户对其进行xselection操作,

xclipboard, glipper (Gnome), parcellite (LXDE), and klipper (KDE) are clipboard managers, maybe wmcliphist as well xcb shows the content of the cut buffers and allows the user to manipulate them xselection,

xclipxselxcopy是将数据复制到或 从X选择中. xcopy具有详细信息选项,可帮助调试X 选择问题.白云母还具有读取和读取的能力 从命令行写入特定的X选择.

xclip, xsel and xcopy are command line programs that copy data to or from the X selection. xcopy has a verbosity option that helps debug X selection issues. parcellite also has the ability to read from and write to specific X selections from the command line.

synergy是跨平台工具,可让您跨多个平台共享剪贴板 多台运行多种操作系统的计算机

synergy is a cross platform tool that allows you to share a clipboard across multiple computers running multiple operating systems

xfce4-clipman-plugin是Xfce4的剪贴板历史记录插件 面板",还有剪贴板管理器xtranslate会在 多语言字典中的Xselection autocutsel同步剪切缓冲区 和选择缓冲区

xfce4-clipman-plugin is a "clipboard history plugin for the Xfce4 panel" and also a clipboard manager xtranslate looks up words in the Xselection in a multi-lingual dictionary autocutsel syncs cut buffer and selection buffer

理论上,X11简短地具有2个剪贴板":实际上是键盘,并且用于选择-按下鼠标中键可以将立即选择的文本粘贴到所需的任何位置,而实际的键盘"用于主菜单/默认菜单剪贴板的目的是通过不同类型的对象进行交换.

Shortly, in theory, X11 has 2 "clipboards": actually a keyboard and for selections - the text you selected immediately can be pasted anywhere you want by pressing middle-mouse button while actual "keyboard" is made for main/default clipboard purposes as exchange by different kind of objects.

P.S.我的经历结束后,我将不再使用x11.享受:)

P.S. I'd not work with x11 anymore after my experience. Enjoy :)