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