Adobe Air - can you use a multitouch event instead of a mouse event to drag a native window? - air

I am looking to use the nativeWindow.startMove() to drag the chrome around, but with a touchEvent rather than a mouse event. I'm not sure if this is at all possible after extensive googling.
I have also tried to dispatch manual mouseEvents when a touchEvent is fired.
Ultimately is the startMove function strictly a mouse only driven function, or can I force this to occur through a touchEvent?
Any input would be most grateful :)

You can manually change x and y properties of the NativeWindow in response to TouchEvents, not necessary using startMove().

Related

konva.js behavior when the mouse button is pressed

I ask if konva.js may behave like other graphics libraries as Raphael.js or Paper.js when the mouse is pressed and then leaves the canvas or browser window, this video illustrates the difference in behavior by default.
https://www.youtube.com/watch?v=DeBNJiN_Vdo
Is there a trick to konva.js work the same way?
(google translator)
It is fixed in develop version.
You can get the last build here: https://raw.githubusercontent.com/konvajs/konva/master/konva.js

Cocoa: how to prevent mouse move past coordinates?

Final goal is to prevent mouse move to another screen (dual display setup) unless a hotkey is held.
The best I came up with, is this:
[NSEvent addGlobalMonitorForEventsMatchingMask:NSMouseMovedMask handler:^(NSEvent *mouseMovedEvent) {
// does nothing yet
}]
The reason I went for global monitor is that my app does not have any windows (and views), it's a status bar app. So NSTrackingArea went home.
Any help would be much appreciated. In Java world, I would simply preventDefault() the event object. Now I need to get the same functionality in Objective-C. Ideally, I'd wish there would be "MouseMovedPastScreen" event, but apparently there's not.
Thanks.
EDIT
Again, in Java, I would get the bounds of both screens, and stopped mouse at the corner positions. And then would allow the event to bubble if the ⌘ key has been held during the event execution.
Controlling the mouse cursor From the Quartz Display Services programming guide. Particularly
CGAssociateMouseAndMouseCursorPosition (false);

How to be notified in OS X when a drag operation *starts* anywhere?

I'm wondering if there's any way to have my application be notified when a drag-and-drop operation starts anywhere on the screen, even if I don't have an active window there.
I've looked into the normal drag-and-drop APIs, but I haven't spotted anything that does this. The NSDraggingDestination protocol along with the -[NSWindow/NSView registerForDraggedTypes:] method allows you to notice when someone is dragging something and that crosses over into your window, but I'd like to notice it when any dragging operation is started anywhere on the screen.
Any tips on how to go about this? Is there a standard Cocoa API for it, or is there a private API / some kind of dirty hack to get this information?
Thanks in advance :)
Take a look at NSEvent’s +addGlobalMonitorForEventsMatchingMask:handler:. I’m not sure if you can track mouse dragging but it’s certainly possible to track mouse button up/down events.
i haven't done it,
but i am assuming you need some kind of external software monitoring ALL mouse activity on the system, and reporting it to your app (or your application doing this itself),
as dragging events are usually reported in your app only when there is activity inside your app's window..

cocoa mousedown on a window and mouse up in another

I am developping a Cocoa application and I have a special need. In my main window, when I mouse down on a certain area, a new window (like a complex tooltip) appears. I want to be able to do:
- mouse down on the main window (mouse button stay pressed)
- user moves the mouse on the "tooltip" window and mouseup on it.
My issue is that the tooltip window does nto get any mousevent until the mouseup.
How can I fix this?
Thanks in advance for your help,
Regards,
And it won't since mouse is tracked by the main window. However, you can process mouseUp in the main window, transform click coordinates into the desktop space, get tooltip window frame and check whether the click occurred on the tooltip. After that, you can send a message to the tooltip window manually.
Or you can try to find another way to implement the final goal :) It is usually better to follow the rules, in this case - mouse tracking.

How to catch scrolling events in wxGTK?

I have a wxTextCtrl with a vertical scrollbar. I need to capture scroll events from the text control's scrollbar. I have a handler for EVT_SCROLL but it only gets invoked on the Windows build. On wxGTK it does nothing. Is there any way to make this work?
No, EVT_SCROLL, like many other events, only works for wxWidgets windows and not the native ones.
You can use wxRichTextCtrl or wxStyledTextCtrl but you probably won't find any way to be notified about scrolling in the native GTK+ text widget.