[vtkusers] vtkFLTK

Sean McInerney seanm at nmr.mgh.harvard.edu
Fri Nov 5 11:08:19 EST 2004


Hi Louis,

   The ability to handle a trackball *and* a mouse as separable input 
event streams is beyond the powers of VTK or FLTK. i.e. Moving either 
the mouse *or* the trackball will generate FL_MOVE events (and 
subsequent invocation of OnMouseMove()). By making use of the 
programmability that your trackball likely possesses, however, you may 
be able to achieve the behavior that you desire. For example, the 
trackball buttons could be renumbered as mouse buttons 4 -> N. Perhaps 
trackball movement could always be accompanied by event state modifier 
keys such as  Fl_SHIFT + FL_META. Who knows? ... You'll have to dream up 
some way of distinguishing between the mouse events generated by the two 
devices.

   You can probably handle the input via either VTK or FLTK event 
mechanisms. Ultimately, FLTK is forwarding events from its main loop to 
the vtkRenderWindowInteractor associated with a Fl_VTK_Window. The most 
efficient place to implement your custom behavior is in the handle() 
method of your own specialized subclass of Fl_VTK_Window. The more 
flexible means is to implement your own vtkCommand subclasses to be 
added as observers of the vtkInteractorStyle held by the Interactor.

Good Luck!

-Sean

Louis Desjardins wrote:
> Hi Sean
> 
> Thank-you for your response,
> 
> So I don't want to use my trackball-mouse as a pointing device, instead, 
> I want to be able to do something like: if a user moved the trackball 
> left, then a "hello" message would output.. (just as an example)
> Along those lines anyways..
> 
> Right now I have 2 mice on my PC, one connected through USB, the other 
> through the PS/2 port..
> 
> So can I somehow just get outputs from the trackball mouse to use in my 
> application as described above?  I am new to FLTK, so maybe its simpler 
> than I am imagining.. Which functions should I look at for this (if its 
> possible)
> 
> Thanks again
> LD
> 
> 
> 
>> Hi Louis,
>>
>>   What is it that you want to do? How does the event output from your 
>> trackball differ from any other pointer device such as a mouse? e.g. 
>> there is no device-specific information about trackballs per se in the 
>> VTK docs either. I would expect you should be able to use a trackball 
>> just as you would a mouse.
>>
>> -Sean
>>
>> Louis Desjardins wrote:
>>
>>> Hello...
>>>
>>> I was wondering if I can interface to a trackball mouse with vtkFLTK? 
>>> I cna't find anything on trackballs in the documents...
>>> I want to be able to control what my application does according to 
>>> the trackball's motion
>>> Thanks
>>>



More information about the vtkusers mailing list