
Signature
What I write is what I mean. I request that anyone who decides to respond
please refrain from "disagreeing" with something I didn't write in the first
place.
>> Does anyone know how to do this?
>> Can you provide me any good links?
[quoted text clipped - 5 lines]
> What are you actually trying to do? What do you mean by "controlling the
> mouse and keyboard?"
Sorry I was too concise for anyone to see what I was saying. I am talking about
simulating the actions of a human user with software. MS Windows has several OS
functions for this purpose. mouse_event(), keybd_event(), and SendInput(). I
want to know whether or not Mac OS has this same sort of feature, and what the
feature would be called.
David Phillip Oster - 28 Oct 2006 05:23 GMT
> >> Does anyone know how to do this?
> >> Can you provide me any good links?
[quoted text clipped - 14 lines]
> the
> feature would be called.
It is called "GUI Scripting". It is part o Universal Access. It is off by
default. It is off on over 90% of all Macs. It is a security hole. It
can be enabled by the user on the "Universal Access" panel of System
Preferences by selecting the [] Enable Access for Assistive Devices.
http://developer.apple.com/documentation/AppleScript/Conceptual/AppleScriptX/Con
cepts/as_related_apps.html#//apple_ref/doc/uid/TP40001570-1149074
In addition, there are USB driver kits that show you how to write virtual
keyboards and mice. Installing these requires getting the user to agree
to a security dialog.
There are system calls in Core Graphics to move the mouse that are not
restricted.
Peter Olcott - 28 Oct 2006 15:07 GMT
>> >> Does anyone know how to do this?
>> >> Can you provide me any good links?
[quoted text clipped - 25 lines]
> keyboards and mice. Installing these requires getting the user to agree
> to a security dialog.
When you say USB kits do you mean that the keyboard and mouse can be
automatically controlled through using a USB hardware device, or can they be
controlled using software only?
> There are system calls in Core Graphics to move the mouse that are not
> restricted.
David Phillip Oster - 28 Oct 2006 17:07 GMT
> When you say USB kits do you mean that the keyboard and mouse can be
> automatically controlled through using a USB hardware device, or can they be
> controlled using software only?
Gregory Weston said, if you want the keys to go up and down, you'll need
to use your fingers or other hardware.
See for yourself at:
http://developer.apple.com/hardwaredrivers/usb/
Peter Olcott - 28 Oct 2006 17:36 GMT
>> When you say USB kits do you mean that the keyboard and mouse can be
>> automatically controlled through using a USB hardware device, or can they be
>> controlled using software only?
>
> Gregory Weston said, if you want the keys to go up and down, you'll need
> to use your fingers or other hardware.
It is not that way on MS Windows, SendInput() simulates the actions of a human
user on both the Mouse and the Keyboard. SendInput() replaces the older
mouse_event() and keybd_event() system calls.
> See for yourself at:
> http://developer.apple.com/hardwaredrivers/usb/
Jens Ayton - 29 Oct 2006 01:07 GMT
Peter Olcott:
> Sorry I was too concise for anyone to see what I was saying. I am talking about
> simulating the actions of a human user with software. MS Windows has several OS
> functions for this purpose. mouse_event(), keybd_event(), and SendInput(). I
> want to know whether or not Mac OS has this same sort of feature, and what the
> feature would be called.
CGEventCreateMouseEvent()
CGEventCreateKeyboardEvent()
CGEventPost()
CGEventPostToPSN()

Signature
Jens Ayton
Peter Olcott - 29 Oct 2006 03:43 GMT
> Peter Olcott:
>>
[quoted text clipped - 11 lines]
> CGEventPost()
> CGEventPostToPSN()
That is exactly what I needed, thanks.