[Gambas-user] how to flush a process stream
Laurent Carlier
lordheavym at ...626...
Wed Mar 30 00:13:25 CEST 2011
Le mardi 29 mars 2011 04:33:21, Kevin Fishburne a écrit :
> I'm reading input from a gamepad by using code such as:
>
> pad_device = Exec ["cat", "/dev/input/js0"] For Read As "Gamepad"
>
> Public Sub Gamepad_READ()
> ' Process the gamepad input.
> End
>
> The problem is that analog stick movements create a LOT of read events
> which are generated far faster than the frame rate of the application.
> How can I clear the events queued by the Gamepad stream?
>
> Also, how can I continuously read events from the stream until it is
> empty? I might want to clear it like that so I can ignore some events
> and process others. Thanks!
Did you try to use a gamepad with sdl component ? because i'm currently
designing such api for gambas3, i guess it will not be too long before i can
commit the code.
++
More information about the User
mailing list