LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 06-21-2005, 05:20 AM   #1
pihu
LQ Newbie
 
Registered: Jun 2005
Posts: 11

Rep: Reputation: Disabled
Coordinate Capturing of selected area


Hi,

For my project i need to get the co-ordinates for the current window or the coordinates of selected area by mouse on desktop or current window.

This is supposed to be independent of KDE or Gnome or any other windows manager.

Any hints how to do it ???

Am i supposed to hook into Xlib calls or there is some other way possible ???

Pihu
 
Old 06-21-2005, 05:56 AM   #2
Marius2
Member
 
Registered: Jan 2004
Location: Munich
Distribution: SuSE 9.2, 10.2, 10.3, knoppix
Posts: 276

Rep: Reputation: 31
Not sure if it does exactly what you need, but you may want to take a look at
xwininfo, which usually comes with an X server. Just type xwininfo at the
console.


HTH
 
Old 06-21-2005, 06:43 AM   #3
pihu
LQ Newbie
 
Registered: Jun 2005
Posts: 11

Original Poster
Rep: Reputation: Disabled
No HTH I actually want to know that if I select some area like when we press the mouse button & drag it one some area on the desktop we select some part of the screen .So how to get the coordinates of that captured area.

Pihu
 
Old 06-21-2005, 07:33 AM   #4
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 66
I only have rough ideas for you, but I hope this helps anyway...
I think you can't do that directly. But you should be able to catch mouse events, and thus detect where it goes down, and where it goes up. Until the "up" event occurs, you would then have to forward each event to the underlying window.
Linux is all open-source, so you may find your answer in the source code of xev, or that of xmerlin (http://www.hellkvist.org/software/index.php#XMerlin). You may also find interesting things in the source code of http://mmkc.sourceforge.net/

Yves.
 
Old 06-26-2005, 10:53 PM   #5
programmer_linux
LQ Newbie
 
Registered: Jun 2005
Posts: 1

Rep: Reputation: 0
hi ,
i am facing the same problem ,if u got any solution please let me know,
Thanks in advance
 
  


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
Event Capturing rem1986 Linux - General 2 12-13-2005 12:11 PM
System slows down when large area is selected cassini83 Linux - Software 2 12-01-2005 06:26 AM
Best Capturing tool. mayankjohri Linux - Enterprise 0 01-30-2005 03:12 PM
Capturing X Events phrontist Linux - Software 1 10-28-2004 08:56 AM
Capturing video with Cinelerra works, capturing video with Xawtv doesn't! seaelf Slackware 0 06-27-2004 05:18 PM

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

All times are GMT -5. The time now is 05:05 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