Record mouse movements, clicks and keyboard input using Java or C ++

I want to be able to record mouse movements, clicks and keyboard input from the user. It would be great if it were a cross-platform solution.

I would like to return something like this (pseudocode):

the mouse moved to 500, 500 mouse double-clicked the mouse moved to 800, 300 mouse left-clicked the keyboard typed "Hello World"

Are there any classes in C ++ or Java that can do this? If I were using C ++, I would probably work with a QT map.

Edit:

I should have said it initially, but I want to record movements and clicks outside of gui applications, so on the desktop too.

+5
source share
5

GLUT , OpenGL, .

OpenGL -.

0

, - , . :

  • SDL, .
  • , X11, Windows, Mac OS X ..
0

, , - . , - .

Windows 17- (!) . (, !)

0

Windows Journal Record Hook. C ++, java, , , . , , , .

Windows, SetWindowsHookEx, WH_JOURNALRECORD, .

You can also (possibly) get this work by setting both WH_KEYBOARD_LLthis and WH_MOUSE_LLthat, but your two hook routines will be called separately, and you will have to write your own code to organize the events.

I doubt you will find a cross-platform solution.

0
source

It seems that Qt may allow you to implement event filters that go beyond the application into the window system. See Also Qt - a top-level widget with keyboard and mouse event transparency?

0
source

All Articles