Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 03-08-2003, 09:48 AM   #1
LQ Newbie
Registered: Feb 2003
Posts: 7

Rep: Reputation: 0
how to fire mouse event using 'C' code

Hello all,

I am doing a project in linux.I want to move and fire the mouse events programtically on the desktop. For example , let mouse be on the position 100,100. I want to move the mouse to x,y position using my 'C' code and fire a mouse click there. Is there any interrupt in 'C' or low level OS interrupt.

bye ...
Old 03-08-2003, 10:01 AM   #2
Senior Member
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
There is a function in C called the 'system' function. The general syntax is as follows:


The system function passes whats in the quoatation marks directly to the shell. If you can figure out how to do this task from a shell prompt then you can do it through your C code.
Old 03-08-2003, 11:35 AM   #3
Senior Member
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 50
Check out the source code for xev, which tracks (and reports) X
events, including mouse movement and clicks as well as keyboard
events. If you can report it, you can probably send it. . .


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
how to fire mouse events programatically in 'C' code karthikeyan Programming 2 11-14-2010 02:03 PM
Help moving mouse with code. nonconformative Programming 1 12-02-2003 06:44 PM
key binding to mouse event agb32 Linux - General 0 09-04-2003 09:19 AM
CATCH mouse event!!! hongzhang Linux - Software 0 08-07-2003 02:19 AM
How can i get the mouse event on gtk_drawing_area? HopeCao Programming 1 03-19-2003 03:53 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:11 PM.

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