Bookmark Topic Watch Topic
  • New Topic

Detect keypress and mousepress  RSS feed

 
Ranch Hand
Posts: 643
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
How to detect keypress and mousepress on other application.
i.e. Even if my control is in on other application my application should detect keypress and mousepress.

Thanks in advance.
 
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
You can't. Key and Mouse listeners only work when the application window has focus.
 
Sheriff
Posts: 21288
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator
The only option is to use JNI to detect the mouse clicks before your operating system sends them to the application.
 
It is sorta covered in the JavaRanch Style Guide.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!