0

Hi Everybody,

Is there a way to have a picture of the 3 or 4 sq. pixels you're mouse is hovering over appear in the bottom of the screen?
Thanx.

6
Contributors
6
Replies
12
Views
11 Years
Discussion Span
Last Post by volvo14
0

I don't think you can do that in Java. You can do it in C++ easy enough by installing an OS hook. Used generally by macro programs and spyware.

But I don't think Java has this kind of access to WIN32. Maybe through JNI?

Jeff Heaton
http://www.heatonresearch.com

1

You can get the mouse coordinates of the mouse.
That will give you the location on screen.
From that you could get the Component the mouse is over.
From that you can retrieve a Graphics object which can draw that component.
From that you can retrieve an offset Graphics object which can draw that component somewhere else (if I read the API docs correctly).

What I don't know is whether any of that will do you much good :)

0

if a java keylogger is unavailable therefore the ability to simply count the number of keystrokes must be the same.

does anybody know of a simple keylogger that counts the number of mouseevents and keystrokes? or failing this one that outputs to a text file which can then be read later on?

1

you could try to write one yourself.
a bit like:

if ( mousePressed() ){
  while(mousePressed() ){}
  System.out.println("mouse is pressed");
}

logic

also, for a next time, there's no need to revive threads that have been inactive for over 4 years, you are allowed to create your own.

Edited by mike_2000_17: Fixed formatting

0

thanks luke, ill keep that in mind...just wondering if it will work like the c++ logger mentioned abov ...ie at operating system level its a fairly important feature, but with file output would be easy to a: buffer the keystrokes and can then process in the background, and b: save embedding c code in a pre written java program.

ill look in the forums n see if theres a nire recnt thread...thanks again, and for the advice to a noob.

Pete

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.