Switching events off

View: New views
2 Messages — Rating Filter:   Alert me  

Switching events off

by marun :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm writing entropy harvesting class using linb event model, so I need from time to time connect to mouse and keyboard's events and after gathering enough entropy disconnect. How can I switch off events to which I have been connected?

EX:
-------------------------8<-------------------------------------------------------------------------------------
linb(document.body).onMousemove(function(e){alert(linb.event.getPos(e));});
-------------------------8<-------------------------------------------------------------------------------------

How can I disconnect this? I have tried tips from manual, but I weren't able to stop event. Only if I pass function(){} as callback function it "stops" to trigger an event.

-----------------------------------------------------------------------------------------------------------------------------------
Happy New Year

Re: Switching events off

by linb :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yeah, It should be:

linb(document.body).onMousemove(null);  => clear all onMousemove events(not include beforeMousemove or afterMousemove)

But there's a spelling mistake bug in 0.2beta, before the newer version, you can use

$widget.onMousemove(null,null,true); => clear all beforeMousemove/onMousemove/afterMousemove events.