ons, 19,.07.2006 kl. 11.39 +0200, skrev Denis Oliver Kropp:
> Ville Syrjälä wrote:
> > On Wed, Jul 19, 2006 at 10:51:31AM +0200, Nils Magnus Larsgard wrote:
> >> tir, 18,.07.2006 kl. 15.31 +0200, skrev Denis Oliver Kropp:
> >>> Nils Magnus Larsgard wrote:
> >>>> Hi,
> >>>>
> >>>> My situation: my linux box with directfb doesn't have keyboard or mouse,
> >>>> but 6 buttons as input. I have a driver to use these buttons, but I
> >>>> would very much like to generate keyboard signals to directfb from some
> >>>> of these buttons. For instance: button1 should the 'up' key, button2 is
> >>>> the 'down' key etc.
> >>>>
> >>>> Is there a simple way to pass signals to the keyboard driver, or should
> >>>> I make my own button driver for directfb?
> >>> You can just generate key events in your own driver. Or how are the
> >>> buttons implemented now?
> >>>
> >> For now, we have a simple driver without any interrupts, and so we poll
> >> to read the button status. The plan is to make it interrupt-driven.
> >>
> >> Could I do something like open(some_dfb_device) and write(fd, key_event)
> >> from an outside program/deamon?
> >
> > Just write a linux kernel input driver for your hardware, or if you want
> > your driver to live in user space you can use uinput.
>
> Another alternative is DiVine :)
>
Hehe, I guess I'll write a separate dfb driver when I get this to work..
My temporary solution is now to modify the dfb keyboard driver to listen
for changes on my own linux device, and generate keyboard signals for
the cursorkeys, tab and enter when the buttons are pushed. Is there a
list of the keycodes i can use for "DFBInputEvent.key_code" ?
I tried to set an event.keycode to 9(for tab) as shown below, but I got
no response in my gtk application as you would expect with a "tab"
keypress/release.
code in thread-loop in function keyBoardEventThread()
(inputdrivers/keyboard/keyboard.c):
-----
read(fd, buf, 4);
if(~buf[0]&0x02) {
evt.key_code=9; //button 0 pushed, keycode=9 for 'tab'
evt.type= DIET_KEYPRESS;
evt.flags=DIEF_KEYCODE;
evt.key_code &= 0x7f;
dfb_input_dispatch( data->device, &evt );
}
------
Any views/comments here?
DFB and gtk is up and running on the AVR32 btw.
--
Kind regards,
Vennlig hilsen,
Nils Magnus Larsgård
Summer intern - AVR APPS Group
Atmel Norway
_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users