Ville Syrjälä wrote:
> On Thu, Apr 19, 2007 at 03:24:58PM +1000, Colin Newell wrote:
>
>>I am new to using DirectFB. I have been able to get basic programs working
>>doing output. However I can't get mouse and keyboard input working.
>>
>>- My PC has a PS2 mouse. Do I need an entry /dev/mouse to point to the
>>device
>> file for this? (The device file is /dev/input/mice)
>> (The FAQ says I need /dev/mouse if I'm using a serial mouse. What about
>> a PS2 mouse?)
>
Since sending the questions I have got event driven keyboard and mouse
input to work. I still don't know why
the example that does non-event driven keyboard access doesn't appear to
work. (Still investigating.)
>
> The ps2mouse driver should attempt to use /dev/psaux, /dev/misc/psaux
> or /dev/input/mice.
>
> However I recommend you try the linuxinput driver instead of ps2mouse.
> It will use the /dev/input/eventX device.
What is the linuxinput driver? This is not so important now that the
mouse and keyboard are working, but what do
I need to do to use the linuxinput driver?
>
>
>> If I need to specify the protocol in ~/.directfbrc, what protocol
>>should I
>> use? The X11 config has:
>>
>> Option "Protocol" "IMPS/2"
>>
>> What is the corresponding DirectFB mouse protocol?
>
>
> The ps2mouse driver accepts "PS/2" and "IMPS/2" as protocol.
>
>
>>- I can't get keyboard input working, and have no idea what i'm doing wrong.
>>Can someone explain how directfb reads the keyboard? Does it use a
>>/dev/ttyx file?
>
>
> Yes, the keyboard driver uses /dev/ttyX. If you use the linuxinput
> driver /dev/ttyX is used only to get the keyboard map and
> /dev/input/eventX is used for the actual input events.
>
> Again, I recommend linuxinput.
>
>
>>I do dfb->GetInputDevice (dfb, DIDID_KEYBOARD, &keyboard), and then
>>keyboard->GetKeyState (keyboard, DIKI_XXXX, &state) - but don't get any
>>keys pressed. (This is the technique shown in tutorial example "Moving a
>>sprite with the cursory keys")
>
>
> Run dfbinfo and see what input devices it finds. If that looks decent
> you can run df_input from DirectFB-examples to see what kind of events
> you get.
>
Yes the dfbinfo example showed this for the mouse and kbd:
Input (00) Keyboard (primary keyboard)
Type: KEYBOARD
Caps: KEYS
Input (01) IMPS/2 Mouse (primary mouse)
Type: MOUSE
Caps: AXES BUTTONS
Max. Axis: 2
Max. Button: 2
And the df_input example worked. The only small question mark is that I
noticed that the program can get well
behind the mouse if there is a lot of movement, as if the drawing of the
mouse position crosslines could not keep
up with the mouse movement events, which kind of surprised me.
>
>>- what do I have to do to get a mouse cursor on the screen? If the mouse is
>>correctly configured, will the mouse cursor show up automagically? A
>>mouse X11 style 'X' shaped
>>cursor does display - I presume that when I get the mouse input working,
>>it will control this
>>cursor.
>
>
> What program you're running that has this X cursor (XDirectFB maybe?).
> The default DirectFB cursor looks a bit like a water droplet.
>
Before I was running the directfb programs I had been running an
X-server, but stopped it. After I stop the X-server, then
from then on the X-server's mouse cursor shows up on the screen when a
DirectFB program is run - it always shows
up in the same position and doesn't move with the mouse. I tried a few
things to clear it but couldn't find anything that
worked. DirectFB's mouse cursor is displayed in some of the test
examples, and looks, as you say, like a water droplet.
Regards and thanks,
Colin
_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users