Re: question on TCanvas::HandleInput

Pasha Murat (murat@cdfsga.fnal.gov)
Thu, 2 Oct 1997 10:35:27 -0500


Valery Fine writes:
> On 2 Oct 97 at 1:09, Pasha Murat wrote:
> > is it intentional that TCanvas::HandleInput doesn't have a default
> > for an X/Win event? Right now if an event is different from a small
> > number of events generated by mouse (press-left-button, move mouse,
> > release-left-button etc) TCanvas::HandleInput just returns. For
> > example it is not possible to process a keyboard hit...
>
> The reason for that is Pick() method. Very this method defines what
> kind of the object the Mouse Cursor "is pointing" (via
> DistanceToPrimitive() method of TObject()). To use other events
> some sort of the way to link that event with ROOT object
> must be offered.
> >
> > I'd expect a lot of (potential) users would like to use this
> > feature.
>
> Yes, but for that probably we need first to be able to "Select"
> some object with the very mouse event (actually it should a
> separate method called by the mouse events) and THEN apply another
> events. (See TObjectView class descrition as example too)
>
Here is a proposal:

When a window (canvas) is keeping focus, there is always a way to
remember current position of the pointing device (mouse), so mouse
position with respect to the "active" window is *always* defined.
When a keyboard is hit TPad::Pick defines picked object as the one
which is being pointed to by the mouse (in this case it is not
necessary to click on the object to select it).


BTW, I also failed to get double click event processed - which event
(in ROOT notations) corresponds to it?

Regards, Pasha.