Capture mouse wheel movement

Sure is. I dropped this into the Power Table’s initialize event hook since it’s nice to have it only fire once. If you add this, you’ll probably want to close the window and re-open it to make sure the listener was actually added.

	from java.awt.event import MouseWheelEvent
	from java.awt.event import MouseWheelListener
	
	class DebugMouseWheelListener(MouseWheelListener):
		def mouseWheelMoved(self, event):
			print "Scroll wheel notches moved:", event.getWheelRotation()
			print "Units to scroll:", event.getUnitsToScroll()
			
	self.addMouseWheelListener(DebugMouseWheelListener())
6 Likes