Ok So what I did for keyboard events is write a small driver that does
nothing, a virtual keyboard. Input drivers register a bitmask for keys
they support, it registers for all of them. I than write an
input_event structure to the driver and event hub picks it up. I also
had to create an appropriate keyboard layout file. This problem was
solved as an attempt to get a vnc server running on the phone. I
wanted it to be as indepenedent of android frameworks as possible
since they are subject to change. I have a working vnc server, you can
check out the source here, I also posted the kernel module I worte.

https://bitbucket.org/billcroberts/android-vnc-server

On Jul 25, 5:47 pm, Nigel Sheridan-Smith <[email protected]> wrote:
> Its in Java, not C/C++ - frameworks/base/services/java and
> frameworks/base/core/java
>
> 2011/7/26 badcc0de <[email protected]>
>
> > Is this completely native? When I grepped for those classes, I could
> > find KeyEvent but I could not find ServiceManager as a native class.
> > Can you also assist in the include files and libs?
>
> > On Jul 25, 1:39 am, "[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

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

Reply via email to