Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: How to do synthetic drags
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to do synthetic drags



Hi,

At 1:40 AM -0400 23/9/04, Who Am I wrote:
I tried to hack a Carbon sample from the Developer samples (I've never done Carbon before, so I didn't even know how to hook up an event handler), and I think I replicated my previous code in a Carbon app. I achieved the same results. I basically got it to wait for 2 seconds (using a CFTimerRef), do a mouse-down with CGPostMouseEvent(), wait 3 more seconds, and then do a mouse-up with CGPostMouseEvent(). Again it doesn't seem to work for me. I am coding this on a Powerbook without an external USB mouse (using the trackpad)....do you think that would have anything to do with it?

No, it should work with or without devices connected, that is cool thing about the CGRemote API.


I've downloaded your trial versions of Keystrokes and Switch XS...very impressive stuff. However, I think it is a bit overkill for what my friend needs. She is not that adept at computing, and I just wanted to give her something simple to do clicking and dragging with her head mouse (she is mostly into games and stuff that doesn't require key input). It's also kinda of a personal thing where it'd be cool that I was able to actually code something to help her out. It doesn't have to be commercial quality or anything, just something she can use.


Regarding the overkill, that is why I suggested you also check out RJ Cooper's SmartClick. That should only have the functionality she needs I would expect (again, I have not actually tried it, so this is based on just how it was described to me). Keep in mind that certain games also require key input. But, yes sure, it can be nice to do something like this yourself.


I noticed that in your two programs (Keystrokes and Switch XS), each have a drag function. However, they act differently. You seem to have figured out how to do the drag correctly with Keystrokes, but when I try it with Switch XS I get the same behaviour as my code. The drag does work in Switch XS if I do it completely with the joystick (i.e. I emulate the mouse moves as well), but not when I do the simulated drag-click and then the physical movement of the trackpad.

That is correct and the way it was intended. SwitchXS intentionally interupts the drag if the physical mouse is moved. This is so because if a switch user would initiate a drag and then not know how to proceed the computer would be locked down (no longer accepting key or mouse button input) because the button would remain depressed. This would mean that a helper could only help by borrowing the switch user's switch (which is not always pratical). By breaking off the drag when the physical mouse is moved it is easy for a helper to regain control of the computer and help out :-)


BTW, I think you just answered your own question: you need to emulate the mouse moves as well, that is what you are probably doing wrong and why your drag does not work.

david.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: How to do synthetic drags (From: Who Am I <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.