• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Is there a way to listen to mouse events without a window (or outside a window)?  RSS feed

 
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I start a java application, but don't have a window/frame/panel, etc, can i still listen to mouse move events? What about if I do have a window but the mouse move events are occurring outside the window?
 
Marshal
Posts: 60142
188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will have to try it, but I think you can only "listen" to mouse events inside the bound of a GUI. Try a MouseListener and see what happens when you click outside your GUI; I suspect nothing will happen.
 
Dan Bizman
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Campbell Ritchie:
You will have to try it, but I think you can only "listen" to mouse events inside the bound of a GUI. Try a MouseListener and see what happens when you click outside your GUI; I suspect nothing will happen.



It does not work but you can use Robot to make the mouse move outside any frames. I don't know why Robot wasn't given the ability to listen to mouse movement outside a window. I'm pretty sure it can be done and I think it can be done in .Net.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!