(a) That is using a bunch of internal functions, so is going to randomly
break across different platform versions and devices.

(b) And anyway, just getting to internal functions does not allow you to
violate the platform's security policies, so this still only allows you to
send events to windows owned by your own app.

On Sun, Jul 24, 2011 at 10:39 PM, [email protected] <[email protected]>wrote:

> In android framework you can inject key event like this:
>
> KeyEvent up = new KeyEvent(KeyEvent.ACTION_UP, eventCode);
>
> /*Get injectkeyevent()*/
> ((WindowManagerService)ServiceManager.getService("window"))
>                                                .injectKeyEvent(down, true);
>
>
> best regards,
> chris
>
> On 7月23日, 上午7时17分, Nigel Sheridan-Smith <[email protected]> wrote:
> > Look at frameworks/base/libs/ui - in particular the EventHub class
> >
> > developer/simulator/app also has code for injecting key / mouse events
> into
> > a stream of "IOCTL calls"  that may do exactly what you want.
> >
> > Cheers,
> >
> > Nigel
> >
> >
> >
> >
> >
> >
> >
> > On Sat, Jul 23, 2011 at 1:02 AM, badcc0de <[email protected]>
> wrote:
> > > Hello,
> >
> > > I am working on building an android vnc server, and I am trying to
> > > figure out a good way to inject events into the android framework. I
> > > need to inject multi touch and keyboard events into the system. I am
> > > on Android 2.3 and Kernel 2.6.35.7.
> >
> > > I have tried to do the following:
> > > modifying the hard keyboard's .kl file to include key syms for
> > > characters and than writing that keysym into the dev node, but that
> > > failed.
> >
> > > Thanks
> >
> > > --
> > > unsubscribe: [email protected]
> > > website:http://groups.google.com/group/android-porting
>
> --
> unsubscribe: [email protected]
> website: http://groups.google.com/group/android-porting
>



-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting

Reply via email to