You are not logged in.

Dear visitor, welcome to KDE-Forum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Thursday, August 26th 2004, 4:07pm

Injecting mouse events with cron

Hi , I'm using mandrake10 with the supplied kde3.2 version.

I'd like to find a way to inject a mouse click on the current position or any other position on screen with a cron job. Is this possible in any way ?

I'm trying to rid myself of any windows boxes , but the above has to be somehow accomplished.

As long as xfree recieves a LMB click with a cron job I'd be happy !
If there is a way to manipulate the mouse position in one move I would really like to hear about it.

I have searched about any keyword on google (macro script mouseevent ...) but i only turned up Xmacro.
http://xmacro.sourceforge.net/

It states what I need to have done but I can't install it because it needs some header files I don't know about. The last change to the project was in 2001 so that might have something to do with it.

Thank you in advance !

2

Friday, August 27th 2004, 11:35am

As at the moment no one is in need of such application I'll continue my search in the wood called Java.

So for anyone in need of a readout and reposition and execution of mouse commands while not actually moving the mouse IMHO look into some java applications with ?classes? using robot ;
example :

try {
Robot robot = new Robot();

// Simulate a mouse click
robot.mousePress(InputEvent.BUTTON1_MASK);
robot.mouseRelease(InputEvent.BUTTON1_MASK);

// Simulate a key press
robot.keyPress(KeyEvent.VK_A);
robot.keyRelease(KeyEvent.VK_A);
} catch (AWTException e) {
}




So now I'm going to learn to program Java huh. yeah , whatever , anyway thanks for not totally having removed this topic.

Cheers

m4ktub

Intermediate

Posts: 257

Location: Lisbon, Portugal

Occupation: Software Engineer

  • Send private message

3

Saturday, August 28th 2004, 2:42am

I guess that is really a good approach. Other approches would force you to implement a little C program to use the xlib XSendEvent call. Although faster it's a more complex development.