Dev:GSEvent

GSEvent is a group of C functions located in GraphicsServices.framework that passes hardware events around the system. GSEvent is a core part of UIEvent, which is simply a wrapper around GSEvent.

GSEvents are sent using Mach messages. A basic event consists of the following information:
 * The type of event.
 * Location and time of the event.
 * Which process sent the event.
 * Which window should receive the event.

Event types
Some events can be used only for. They will usually become no-op when sent to non-SpringBoard apps. Note that some sensor events like the gyroscope and magnetometer are processed in by directly communicating with the HID subsystem, instead of via the slower GSEvent system.

Sending a GSEvent
In order to send a GSEvent, one must first create a struct consisting of a GSEventRecord followed by the actual event data. Below is an example of creating and sending an orientation event to a specific process.

Purple system event port
The "Purple system event port" is the Mach port that receives system events (e.g. kGSEventLockDevice). This port is registered whenever the --RegisterForSystemEvents flag is provided to a UIKit application, or it is the first application that registers the com.apple.eventpump service for bootstrap lookup. In other words, these system events are directed to SpringBoard.

Header

 * http://github.com/kennytm/iphone-private-frameworks/blob/master/GraphicsServices/GSEvent.h