[sldev] adding support for a new input device to the SL viewer

Maurizio de Pascale mdepascale at dii.unisi.it
Mon Sep 17 02:44:26 PDT 2007


Hi Ettore,

> I've been working on something like this on and off for a while (whenever I
> have some free time) and currently I have a solution more or less working
> for controlling the avatar, edit mode and flycam for Windows and OS X. Maybe
> we can work together...
>   
That would be a good idea.
I'll be glad to study how you're approaching the problem and work
together to have it done faster and better (hopefully ;) )
just let me know how you would like to proceed.


> I think so - my approach was not to follow the mouse events flow because it
> was just too crazy and platform specific. To get something moving (quick and
> dirty style) I just added a scanDevice() call after scanJoystick, but that's
> bad as well. The best approach I think depends on what kind of device you're
> working on: if you're working with joysticks, 3D mice or other N degrees of
> freedom devices I say LLViewerJoystick is a good class to expand. That's
> what I'm doing right now.
>   

> Hacking the event system with fake mouse events seem the way to Event Hell
> IMO. This is what I did/am doing (I plan on posting some patches in a few
> days):
>
> - As you know the viewer already uses DirectInput on windows for the flycam.
> On OS X I'm using the HID manager, and I believe there is a library on Linux
> to handle HID devices.
> - I developed an open source library to have a cross-platform API to access
> the device. The implementation is DI on Win and HID on OS X, any other
> platforms can be added by just implementing a few functions. This makes
> viewer code unaware of the underlying implementation.
> - I am refactoring the joystick implementation to use the above library.
>
> Sorry if this is too vague - expect a patch soon.
>
> Ettore
>   

I've looked into the LLViewerJoystick class.
However at a first glance it looks like nothing more than another hack
:( mostly forwarding messages to keyboard input handling.
Looking forward to see your patch.



thank you for your help,
Maurizio de Pascale
mdepascale at dii.unisi.it


More information about the SLDev mailing list