CreateJS - why mousemove is called? - events

I don't need mousemove event.
But there are a lot of mousemove calls in the browser profiler.
I trying use removeAllEventListeners() to all createjs.Stage, but this does not work.

After create new Stage, must call
stage.enableDOMEvents(false)

Related

Detect Click and Hold in OSX

Is there a way to detect a click and hold within a NSView? I want to trigger an event after holding the mouse button down for 0.5 sec - similar to a longPressGesture in iOS.
I don't know of a specific selector for this, which is what it sounds like you're asking for, but you could, quite easily, handle this yourself.
Start a timer when the mouse down event occurs and when the amount of time has passed, react to it if the mouse up event did not occur before the specified elapsed time.

Is possible to know when an event starts to be listened?

I have an object and I want to know when someone started to listen to it.
In my case there is a "click" event in my class which is a wrapper for a canvas element. How might I attach the event to the canvas when someone is listening to the wrapper?
thanks (:
(crosspost because only 3 views and no reply yet)
You can overwrite addListener() in you wrapper to call your code everytime it is called.
I am really not sure what do you intend to do. There is canvas element for which you can listen to it's events. Once it's fired in there, you can fire "click" in your wrapper class. You don't need to know exact listeners registered.

Responding to mouseMove events in stacked views

I have a window (NSWindow) with a series of views on it. One of these views accepts mouseMove events. I want to be able to connect a line between two different views with the mouse. So, what I've done, is created a larger view that covers the entire window and I draw my line in this view. This works fine.
The problem is that if I allow my larger, overlapping, view to accept mouseMove events so the line follows the cursor, then my visible view stops receiving mouseMove events. This is a problem because I want certain objects to "light up" on the underlying view when my mouse hovers over them and I do this in that view's mouseMove method.
How can I get mouseMove methods called in both the invisible overlapping view and the visible view below?
check which options you are using to initialize your NSTrackingArea...
if I recall correctly you should be able to use NSTrackingActiveAlways and get the mouse events whether you are first responder or not. it shouldn't matter if your views are stacked, as long as they register their own tracking areas they should receive the events...
http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/NSTrackingArea_class/Reference/Reference.html
You can have the mouseMove method of the overlapping view send the mouseMove method to the underlying view.

What's the difference between logical events and native events in GWT?

I notice that there are two methods by which an event handler can be hooked up to a GWT widget: addHandler and addDomHandler. The JavaDoc for addDomHandler says, "Adds a native event handler to the widget and sinks the corresponding native event. If you do not want to sink the native event, use the generic addHandler method instead."
I'd be very grateful if someone would enlighten me as to the difference between native events and logical events.
Native events are fired directly by the browser - events like clicks, mouseovers, keypresses, etc. To receive those events on a Widget, you have to specifically sink the events.
The generic events are, well, more generic. For example, I've created a SaveEvent and a DeleteEvent for my own use, that get fired when certain UI conditions are met. They are farther away from the browser and would never get fired directly by the browser. I think you should stick with the more generic events when you can. On the other hand, if you're creating a custom widget that you can't make out of other widgets - for example, if you want to build a slider that the user can click and drag - you'll need the DOM events.

How do I accelerate the touchesBegan event firing?

I have a UIView where I use the touchesbegan event, but I realized that once I put my finger on it, the touchesBegan event takes like 1 or 2 seconds to fire. How can I make this happen faster?
thanks!!!
After trying some stuff out, I realized that the delay happens only on custom UIButtons. If I "simulate" a button with a regular UIView subclass I get the correct behaviour.

Resources