"Brian S. Julin" wrote:
> 
> On Tue, 26 Jun 2001, Stefan Seefeld wrote:
> > Is this a deliberate choice, or would it be equally possible to make a
> > synchronous call ?
> 
> I think it is deliberate -- consider when a USB device is plugged into
> the live USB wire.

right, that's what I was thinking about...

> > Any hints would be highly appreciated.
> 
> The hint is hidden in the header:

thanks, I read that :)

> 
> /* This event is sent/received to require/get the capabilities of a device
>  * as specified in target/origin.
>  * An event stating num_buttons=num_axes=0 says, that the device is inactive,
>  * unplugged, whatever. Devices automatically report (detectable) state
>  * changes via devinfo. But you need to re-query the valinfo records.
>  */
> 
> In other words, just send the query and then treat device insertion/removal
> as just another event; have a handler decide when to load/unload any
> LibGII filters e.g. keyboard emulation of mouse pointers based on these
> events when they are received.

well, hmm, I'm not going to do that mapping inside GGI. Berlin has its own
event type system. But anyways, my question isn't really answered. For any
given moment, there must be a number of 'activ' devices. Assuming I have
three devices (keyboard, mouse, tablet), I'd rather wait until all three have
their 'device space' reported before I go ahead to build up the mapper.

Or do I really need to put a little waiting loop into the initialization
(one sec, say), to give GGI a chance to report back all input devices ?
That would probably do the trick, but doesn't sound right.

May be the trick is to 'decode' the 'all' flag, i.e. to transform the
broadcast into a set of direct requests. That would be similar to asking
for a number of (potentially inactiv) devices, so I could loop over them
and ask each individually.

Regards,
                Stefan

Reply via email to