Hi,all
    I've found a strange bug in DFB's inputdrivers(keyboard.c), it seemed that 
the DFB driver dispatched more keypress event than real.
    That is to say, when I press a key (let's say 'a') down and hold for 1 
second to realize the 'repeat' function, then in the linux kernel debug, I got 
maybe 9 times 'a' key press interrupt occured, but in the DFB's keyboard 
driver, I got more than 7 times 'a' key press event(the amount is 60~90 times 
maybe).

    And, I've changed the function keyboardEventThread()(in keyboard.c) as 
below,

static void*
keyboardEventThread( DirectThread *thread, void *driver_data )
{
    ... ...
     /* Read keyboard data */
     while ((readlen = read (data->vt->fd, buf, 64)) >= 0 || errno == EINTR) {
          int i;

          printf("readlen=%d, evt.key_code=0x%x\n", readlen, buf[0]); //wdl
          direct_thread_testcancel( thread );
          for (i = 0; i < readlen; i++) {
               DFBInputEvent evt;

               evt.type     = ((buf[i] & 0x80) ?
                               DIET_KEYRELEASE : DIET_KEYPRESS);
               evt.flags    = DIEF_KEYCODE;
               evt.key_code = buf[i] & 0x7f;

               //dfb_input_dispatch( data->device, &evt );    // rem here, so 
print is ok!

               keyboard_set_lights( data, evt.locks );
          }

          if (readlen <= 0)
               usleep( 200000 );  //wdl, 2000
     }
    ......
}

    Then, I got the right times keypress event print info, so I think maybe the 
function dfb_input_dispatch() is the bug area, but I can't find how it bugged!
    Anybody suggestion? Thanks in advance!


Sean Wang

wang_don...@hotmail.com

 
_______________________________________________
directfb-users mailing list
directfb-users@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users

Reply via email to