iphon instead Gamepad or joystick

This is my idea, i’m planning to substitute the gamepad with iphone, i’m going to use accelerometer in the iPhone to send messages to the compter.(i’m planning to play “Need For Speed” using IPhone) .
I was able to read inputs from the iphone and i want now to dispatch the event to the operating system, is this possible in JInput or not, or is there any other solution for this and if possible is there any sample code for that, cause i was searching on the net for days and there is not enough documentation but the API docs

JInput is designed for reading details already present at the OS layer, that means that with the existing plugins, under windows, directx or the Raw API. Of course, you could always write either a directx driver for the iphone input, or a plugin for jinput to read the values for however they are exposed.

Endolf

Thank you very much

but can you guide me on from where to start or on what should i serach for and how directx can deal with gamepad or joystick
or if possible is there any java api for connecting with directx.

You will need to write a windows device driver emulating a gamepad. This is not possible using java. Maybe http://stackoverflow.com/questions/1003657/emulating-joystick-programmitically helps.

after long search, i fouund a solution using virtual joystick (ppjoy)
this link contains what i need

and this youtube link show a demonestration but using pattern recognition instead of iphon