Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 860511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:49:43+00:00 2026-05-15T08:49:43+00:00

I sent this to KennyTM (has all the private framework headers on GitHub) but

  • 0

I sent this to KennyTM (has all the private framework headers on GitHub) but I figured I’d ask here too just in case someone has some good ideas or any way to help me out.

I’m trying to write a command line utility that sends GSEvents to operate the keyboard, touch/drag elements onscreen, and operate hardware buttons (volume, home, sleep, etc.)

I grabbed the MouseSupport code and tried to look through it, but I couldn’t find the easiest way to send GSEvents. I’m hoping someone here can help me.

First, what’s the simplest way to declare a GSEvent and send it? I looked at the iPhone development wiki, but the documentation was very vague. I understand that there’s a purple event port (?) that I have to send these events to, but I don’t understand how to do that. Could someone offer examples for, say, touching at a coordinate, typing a certain key, or pressing a hardware button?

Also, do I have to write or do anything special if I want this utility to operate all applications as well as Springboard? I don’t know if this is a special case because I want it at the OS level. Ideally, I would SSH into the phone, start the program, and it would send GSEvents that would be handled by whatever application was open.

As far as compiling this code, is there any way to do so under Xcode? I don’t know what sort of project template I should use (if any) and this is throwing me off. I don’t need “build and go” support, I’m more than happy to scp the program over to the phone. I understand that compiling the code is also feasible on the phone. I have all of the headers from the SDK on my phone along with iphone-gcc, but when compiling some test programs I still get errors about not finding mach headers and CoreFoundation. Is there an easier way to do this?

Lastly, are there other guides or pieces of literature that anyone can point me towards for learning more about this? I’m excited to get into open iPhone development (I have experience with the official SDK, but I want to go deeper).

Thanks for any and all help people can offer!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T08:49:44+00:00Added an answer on May 15, 2026 at 8:49 am

    First, what’s the simplest way to declare a GSEvent and send it?

    It depends on the type of the GSEvent. Some events have convenient functions that can be created and sent in one step, e.g. GSEventLockDevice(). But HID events (touches, key presses, etc.) do not have these simple functions. The reason is likely because GSEventLockDevice() etc are to be sent from the app to SpringBoard, but HID events are sent from SpringBoard to an app. Therefore, only the SpringBoard team needs to know how to construct a complicated GSEvent.

    Anyway, to create a HID event (e.g. accelerometer event) you don’t need to create a GSEvent. Just use GSSendEvent():

    // (not tested.)
    
    GSAccelerometerInfo accel = {0.0f, 0.0f, 1.0f};
    GSEventRecord header;
    memset(&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(&record, thePortOfApp);
    

    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:

    mach_port_t thePortOfApp = GSCopyPurpleNamedPort("com.unknown.appBundleID");
    ...
    mach_port_deallocate(mach_task_self(), thePortOfApp); // remember to release the port.
    

    Also, do I have to write or do anything special if I want this utility to operate all applications as well as Springboard?

    As far as I know, no.


    For the other two, probably you should split them into individual questions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 457k
  • Answers 457k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer con (lack of) portability harder/more error prone pro performance (potentially,… May 15, 2026 at 10:54 pm
  • Editorial Team
    Editorial Team added an answer See this pseudocode for inplace patitioning (from Wikipedia): function partition(array,… May 15, 2026 at 10:54 pm
  • Editorial Team
    Editorial Team added an answer You need to declare the type of your instance var… May 15, 2026 at 10:54 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.