Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / CodeWarrior / October 2006



Tip: Looking for answers? Try searching our database.

Controlling the Mouse and the Keyboard ???

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peter Olcott - 27 Oct 2006 04:31 GMT
Does anyone know how to do this?
Can you provide me any good links?
Gregory Weston - 28 Oct 2006 02:48 GMT
> Does anyone know how to do this?
> Can you provide me any good links?

For the mouse, you place your hand over the top of the mouse. You may
either rest your hand on it or grasp it on the sides with your fingers.
Now move your hand around in a plane parallel to the ground.

What are you actually trying to do? What do you mean by "controlling the
mouse and keyboard?"

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.

Peter Olcott - 28 Oct 2006 03:01 GMT
>> 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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.