Thanks to Denis Oliver Kropp for the support. the program run fine.

But maybe there could be a mistake in another one (like the first)


//the only lib that we need
#include <++dfb.h>
#include <iostream>

using namespace std;

int main()
{
    //here we declare the main interfaces
    IDirectFB              dfb;
    IDirectFBInputDevice keyboard;
    IDirectFBEventBuffer keybuffer;
    DFBInputEvent keyevent;

    //start directfb
    DirectFB::Init();
   
    dfb = DirectFB::Create();
    //set up a keyboard
    keyboard = dfb.GetInputDevice(DIDID_KEYBOARD);
    //set up a keybuffer
    keybuffer = keyboard.CreateEventBuffer();


    while(1) //we start the main cicle, an infinite one
    {
        cout << "PASSED" << endl;       
        keybuffer.WaitForEventWithTimeout(2,0); //let us listen if a key
is pressed
                cout << "NOT PASSED" << endl;
       
        while(keybuffer.GetEvent(DFB_EVENT(&keyevent))) //if there is a
event...
        {   
                       
            if (keyevent.type == DIET_KEYPRESS) //and this event is a
key pressed
            {
                if(keyevent.key_id == DIKI_ESCAPE || keyevent.key_id ==
DIKI_F2) //and it's  hte ESC or F2 button
                return 1;
            }
           
        }
    }
   
   
}

This program should wait forever until F2 or ESC is pressed, but it's
not so.
When the WaitForEventWithTimenout funcion is called for first it return
an error (code 6)

the program is compiled with [EMAIL PROTECTED]:~$ g++ `pkg-config --libs
--cflags ++dfb` try.cc

and the output is 

IDirectFBEventBuffer::WaitForEventWithTimeout(unsigned int, unsigned
int) -> Operation timed out!
(!) [10318:    0.000] --> Caught signal 6 (unknown origin) <--

Killed

Please help me if you know how to fix it (i hope it's the last time that
i pester you)


_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users

Reply via email to