Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 19-01-2010
Member
 
Join Date: Dec 2009
Posts: 292
Detecting end of mouse wheel

Hello,
In my applet, I add support for the mouse wheel. My problem is that when there is action on the wheel, I run a function and as part of this treatment is long. So I would execute this section only when the user has finished "playing" with the wheel while running the reset mouseWheelMoved each. Briefly I want to detect the mouse wheel when it reaches at the end of movement. How can I do this? How to set up a Boolean that proves that the user has finished manipulating the wheel?
Reply With Quote
  #2  
Old 19-01-2010
Member
 
Join Date: Apr 2008
Posts: 2,001
Re: Detecting end of mouse wheel

Hello,
I do not know if it will respond to your question but if you look at the argument that mouseWheelMoved is mouseWheelEvent, as he getScrollAmount method (), so you can run for each "ScrollAmount" your function for small amount movies, and once you're reached the end, the movement will be stopped. I do not know if this is what you are asking or my logic towards it is correct, but your question if difficult to answer.
Reply With Quote
  #3  
Old 19-01-2010
Member
 
Join Date: Feb 2008
Posts: 1,848
Re: Detecting end of mouse wheel

Hello,
I do not think there is the concept of "end of scroll" in java. It just means that you have not scrolled for some time. I say it must manage a timer:
- Each scroll you reset (say, for 1 second )
- If you spent one second without reset (so when you no longer have scrolled past second), you make your function long.
Advantage: it forces you to put your long-acting in another thread that Swing, which will not freeze your display.
Reply With Quote
  #4  
Old 19-01-2010
Member
 
Join Date: Dec 2009
Posts: 292
Re: Detecting end of mouse wheel

Hello,
Thank you to you both. I thought something like this but I would love another way round it. If you have any other alternative to this method, then please post that method and the way to use it. My problem is that when each step of the wheel mouseWheelMoved event is launched I want to capture the action. Do you have any solution for this.
Reply With Quote
  #5  
Old 19-01-2010
Member
 
Join Date: Feb 2008
Posts: 1,848
Re: Detecting end of mouse wheel

Hello,
You may try to create an attribute to your class that you upgrade to each call mouseWheelMoved representing the number of loops you have to do in another function and after this loop. Are you sure he does not "factored" no calls mouseWheelMoved so many notches wheel are made in a short time? Otherwise, actually, my method does not work but in this case I do not see what is their method getScrollAmount if the event is launched at every step of wheel for this function, as I understand, will always return 1. Try to test how it returns every time.
Reply With Quote
  #6  
Old 19-01-2010
Member
 
Join Date: Jan 2008
Posts: 1,515
Re: Detecting end of mouse wheel

Hello,
This would be what you are looking for.
Code:
java. awt. event. MouseWheelEvent

public i getWheelRotation ()

Returns the mouse wheel rotations.
negative values if the mouse wheel was rotated up / away from the user, and positive values if the mouse wheel was rotated down / towards the user.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Detecting end of mouse wheel"
Thread Thread Starter Forum Replies Last Post
Mouse Wheel doesn?t work in VB6 on windows 7 Elazar Operating Systems 5 08-01-2012 10:59 AM
Mouse Scroll Wheel Not Working In Word m3pilot MS Office Support 6 16-05-2011 01:56 PM
Disable Mouse Scroll Wheel Raffaele Operating Systems 2 12-02-2009 05:41 PM
Mouse Scroll Wheel ignored by Office 2007 Indragop Office Setup 5 19-09-2008 12:21 PM
Wheel mouse moves downwards Pyrotechnic Hardware Peripherals 2 07-08-2008 05:23 PM


All times are GMT +5.5. The time now is 10:50 PM.