LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-27-2022, 07:50 PM   #1
MrPolock
LQ Newbie
 
Registered: Oct 2015
Posts: 2

Rep: Reputation: Disabled
how to access in C and Xfce ANY text that was hi-lited with mouse after Ctl-C pressed


I want my C (NOT C++) program to have its input be the text that was
hi-lited with a mouse and then the user pressed Ctl-C.
It would be nice if EVERY time new text is hi-lited and Ctl-C is
pressed my program can be notified that NEW data is available.
I am guessing that my program should run as a daemon and be sent
a USR1 or USR2 signal to tell me that new data was hi-lited.

1 Where is this buffer kept, what is its name, how to access it.
2 What is the OS program name that DOES the pasting to the buffer.
I may need to modify it to send my program a Signal that new text
has been hi-lited, Ctl-C was pressed and new text is in the buffer.

Last edited by MrPolock; 01-27-2022 at 08:03 PM. Reason: added points 1 and 2
 
Old 01-27-2022, 11:10 PM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,880
Blog Entries: 1

Rep: Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871
Possible starting point: https://www.uninformativ.de/blog/pos...OSTING-en.html
 
1 members found this post helpful.
Old 01-28-2022, 03:16 PM   #3
enigma9o7
Senior Member
 
Registered: Jul 2018
Location: Silicon Valley
Distribution: Bodhi Linux
Posts: 1,402

Rep: Reputation: 561Reputation: 561Reputation: 561Reputation: 561Reputation: 561Reputation: 561
I dunno what you're asking. I do know highlighted text pasting with middle click is part of X11 itself, not a particular desktop, and doesnt always work in wayland anymore It is separate and independent of desktops and apps and xclip and pyclip etc copy/paste functionality.

Last edited by enigma9o7; 01-28-2022 at 03:17 PM.
 
Old 01-29-2022, 06:34 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by MrPolock View Post
I want my C (NOT C++) program to have its input be the text that was
hi-lited with a mouse and then the user pressed Ctl-C.
It would be nice if EVERY time new text is hi-lited and Ctl-C is
pressed my program can be notified that NEW data is available.
I am guessing that my program should run as a daemon and be sent
a USR1 or USR2 signal to tell me that new data was hi-lited.

1 Where is this buffer kept, what is its name, how to access it.
2 What is the OS program name that DOES the pasting to the buffer.
I may need to modify it to send my program a Signal that new text
has been hi-lited, Ctl-C was pressed and new text is in the buffer.
Keywords: Clipboard, selection, Primary, secondary...
Try something like 'man xclip'.
or 'apropos clipboard'
Results do not seem to be specific to C but it's a starting point.
Happy web searching!
 
Old 01-29-2022, 08:04 AM   #5
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,152
Blog Entries: 6

Rep: Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835
Source for xorg-xclipboard
https://xorg.freedesktop.org/archive...-1.1.3.tar.bz2

xclip
https://github.com/astrand/xclip

wl-clipboard
https://github.com/bugaevc/wl-clipboard
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Run Script When Any Key Pressed, Run 2nd Script After Any Pause jakfish Linux - General 2 08-25-2016 06:47 AM
XFCE Volume indicator when button is pressed Freaksta Linux - Desktop 1 08-10-2014 10:00 AM
/tftp/access.ctl file not There sagar666 Linux - Server 2 09-10-2013 09:09 AM
Map a keypress to a GUI button (when keycode 175 pressed a GUI button pressed) wikapuki Linux - Desktop 0 09-16-2010 09:08 AM
flickering of screen while returning back to GUI mode from Text mode using Ctl+Alt+F7 varun_shrivastava Linux - Newbie 1 03-30-2007 10:12 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration