ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

C从Linux上的剪贴板中获取字符串

2019-07-16 09:51:20  阅读:287  来源: 互联网

标签:c-2 linux clipboard x11 codeblocks


您好我正在编写一个c程序,我需要将剪贴板上的内容变为字符串变量.我找到了很多解决方案,但所有解决方案都是针对Windows编写的.有没有使用QT库的方法?我找到了与X11相关的东西,但不是很清楚.

非常感谢你

解决方法:

您是否尝试首先找到代码而不是实现的程序?我为你做了这个,发现很多使用直接X11调用的实现.我认为最有价值的是this,但你也可以阅读this.只需找到任何程序并查找来源.尝试在维基百科上查看哪些应用程序使用x11剪贴板/选择系统.

The following programs specifically operate on data transfer
mechanisms:

xcutsel transfers data from selections to cut buffers or vice versa

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,

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 is a cross platform tool that allows you to share a clipboard across
multiple computers running multiple operating systems

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个“剪贴板”:实际上是一个键盘和选择 – 你可以通过按鼠标中键将你选中的文字粘贴到你想要的任何地方,而实际的“键盘”是用于主/默认剪贴板目的由不同类型的物体交换.

附:根据我的经验,我不再使用x11了.请享用 :)

标签:c-2,linux,clipboard,x11,codeblocks
来源: https://codeday.me/bug/20190716/1476722.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有