键盘获取字符串linux c,C从Linux上的剪贴板中获取字符串

您好我正在编写一个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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值