Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>First, what's the simplest way to declare a GSEvent and send it?</p> </blockquote> <p>It depends on the type of the GSEvent. Some events have convenient functions that can be created and sent in one step, e.g. <code>GSEventLockDevice()</code>. But HID events (touches, key presses, etc.) do not have these simple functions. The reason is likely because <code>GSEventLockDevice()</code> etc are to be sent <em>from</em> the app to SpringBoard, but HID events are sent <em>from</em> SpringBoard to an app. Therefore, only the SpringBoard team needs to know how to construct a complicated GSEvent.</p> <p>Anyway, to create a HID event (e.g. accelerometer event) you don't need to create a GSEvent. Just use <code>GSSendEvent()</code>:</p> <pre><code>// (not tested.) GSAccelerometerInfo accel = {0.0f, 0.0f, 1.0f}; GSEventRecord header; memset(&amp;header, 0, sizeof(header)); header.type = kGSEventAccelerate; header.infoSize = sizeof(accel); header.timestamp = mach_absolute_time(); // fill in other members. struct { GSEventRecord record; GSAccelerometerInfo info; } record = {header, accel}; // ... see below ... GSSendEvent(&amp;record, thePortOfApp); </code></pre> <p>But what is "the port of app"? Unfortunately there's no function to get that. As of 3.1, the name of the mach port is same as its bundle ID, so you could use:</p> <pre><code>mach_port_t thePortOfApp = GSCopyPurpleNamedPort("com.unknown.appBundleID"); ... mach_port_deallocate(mach_task_self(), thePortOfApp); // remember to release the port. </code></pre> <hr> <blockquote> <p>Also, do I have to write or do anything special if I want this utility to operate all applications as well as Springboard?</p> </blockquote> <p>As far as I know, no.</p> <hr> <p>For the other two, probably you should split them into individual questions.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload