Using Robots to warp Cursors

A

AJ

Background: I have a JToggleButton. when I select this togglebutton,
I want to lock the cursor in this button. I have done that by using a
combination of mouseListener events (mouseExit, etc) and by warping
the mouse cursor with the Robot class.

Goal: To create a JToggleButton, that when selected, will detect
whether the mouse is moving up or down, and do something accordingly.

Problem: Problem is, I have a mouseExit handler, that when activated,
warps the cursor back to the middle of the JToggleButton.
Unfortunately, this movement is also activating my mouseListener,
making my goal above difficult.

Question: Can I unregister mouseListeners for Robots? Or can I fake
it somehow?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top