RE: [AD] EVDEV mouse driver

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Title: RE: [AD] EVDEV mouse driver

> +   /* Flush the files FIXME not alway flushed */
> +   for (n=0; n<NUM_FD; n++) {
> +      if (fd[n]!=-1) {
> +         while (read(fd[n], buffer_array[n], PACKET_SIZE) > 0)
> +            ;
> +      }
>     }
>
> Could you explain the FIXME ?

After the end of the loop, when not moving a mouse, there are sometimes still
data in one/some devices.  So the progress bar begins to fill up without the
user interaction.



> You don't break on the first successful call to open: purposefully ?
[snip]
> So acquiring is performed for each device...
[snip]
> ... and then only one record is kept ? What if this record isn't recognized
> by any driver, while another one would have been if it had been processed ?

Assuming the user has only one mouse :
We open all the devices because we don't know which one is the mouse.
We ask the user to move the mouse, which means that the mouse device file will
be filled with data.
Then, the "correct" device file is the one from which the most data have been
read.

In most cases data will be read from only one file, unless the user moves
several mice.



> > I've also found that alert doesn't seem to scare the mouse. I didn't
> > investigate.
>
> I can't reproduce on my system (4.1.9 CVS w/ pthreads). Could you craft a
> minimal testcase that exhibits the problem ?

(4.1.9 without pthreads)

#include <allegro.h>
int main()
{
  allegro_init();
  set_color_depth(16);
  set_gfx_mode(GFX_SAFE, 0, 0, 0, 0);
  install_mouse();
  install_keyboard();
  position_mouse(SCREEN_W/2-32, SCREEN_H/2-16);
  alert("ZZZZZZZZZZZ", "ZZZZZZZZZZZZZ", "ZZZZZZZZZZZZZ", "YYY", "YYY", 0, 0);
  return 0;
}
END_OF_MAIN()


--
Annie



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/