3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

How To Connect a PS/2 Keyboard to the iPhone

Step 10The iPhone Client Program

Now to set up the iPhone client program.

For the client code, I’m using a program I found on Anthony Pray’s Google Code page.  This program reads input from the serial port at 19200 bps and then injects the appropriate keyboard event using a VNC client library.  I’ve made a local text-only mirror of the source here, which can be easily fetched with wget.

Since we’ll be injecting keypresses by VNC, you’ll also need to be running a VNC Server on the iPhone.  We’re going to use Veency (which is awesome and you should install anyway).

Go to Cydia or Icy and install the following packages:

  • Veency - Provides the VNC Server, configure it to run at startup
  • LibVNCServer - Provides libvncclient
  • iPhone 2.0 Toolchain - Provides a build environment (gcc, libgcc, ldid, libz are required if you go another route)
  • MobileTerminal - So you can access the iPhone terminal
  • wget - So you can pull down the source file

Now to download and build the source.  Either open up MobileTerminal or SSH into your phone, and then do the following:

  • wget http://awgh.org/files/TouchClient.c
  • gcc -static-libgcc -o TouchClient TouchClient.c -lvncclient
  • ldid -S TouchClient

The last step, using ldid, fakes signing the binary.  Without it, the iPhone OS will kill your process immediately.

To start the program, run it from Mobile Terminal with:

./TouchClient

This will cause Veency to pop up a dialog asking if you want to accept the VNC connection.  Hit Accept.

I’ve noticed that running this from MobileTerminal keeps the program alive even when you leave MobileTerminal, but it would be better to use launchd.  I haven’t figured that out just yet.

« Previous StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
1
Followers
1
Author:awgh