Mouse move and mouse enter Events

Mouse move and mouse enter Events

Post by Marcus Sinderma » Tue, 24 Jun 2003 21:36:32



Hi!

I'm using a SoQtPlaneViewer in my Qt project. To catch mouse events I
use a callback function that is attached to the render area of the
viewer.
But the callback function registers only events when the mouse button
is pressed over the viewer. I also need mouse move and mouse enter
events.
Can anybody tell me how I can do this with the callback function or
are there other ways to realize this functionality?

Bye Marcus

 
 
 

Mouse move and mouse enter Events

Post by Mike He » Wed, 25 Jun 2003 14:25:18



> I'm using a SoQtPlaneViewer in my Qt project. To catch mouse events I
> use a callback function that is attached to the render area of the
> viewer.
> But the callback function registers only events when the mouse button
> is pressed over the viewer. I also need mouse move and mouse enter
> events.
> Can anybody tell me how I can do this with the callback function or
> are there other ways to realize this functionality?

Are you using Open Inventor from TGS or Coin?
(SoQt is not necessarily the same between them)

-Mike
 TGS Inc, http://www.tgs.com

 
 
 

Mouse move and mouse enter Events

Post by Marcus Sinderma » Wed, 25 Jun 2003 18:06:07




> > I'm using a SoQtPlaneViewer in my Qt project. To catch mouse events I
> > use a callback function that is attached to the render area of the
> > viewer.
> > But the callback function registers only events when the mouse button
> > is pressed over the viewer. I also need mouse move and mouse enter
> > events.
> > Can anybody tell me how I can do this with the callback function or
> > are there other ways to realize this functionality?

> Are you using Open Inventor from TGS or Coin?
> (SoQt is not necessarily the same between them)

> -Mike
>  TGS Inc, http://www.tgs.com

I'm using Open Inventor from TGS.

Marcus

 
 
 

Mouse move and mouse enter Events

Post by Mike He » Thu, 26 Jun 2003 14:42:54





> > > I'm using a SoQtPlaneViewer in my Qt project. To catch mouse events I
> > > use a callback function that is attached to the render area of the
> > > viewer.
> > > But the callback function registers only events when the mouse button
> > > is pressed over the viewer. I also need mouse move and mouse enter
> > > events.
> > > Can anybody tell me how I can do this with the callback function or
> > > are there other ways to realize this functionality?

Hmm, you're right, mouse move events are only passed to the
callback when a mouse button is pressed.  However the event
filter in SoQtGLWidget looks like it is always forwarding
mouse move events (when it gets them), so possibly this is
a Qt behavior.  We will have to investigate.

As a work-around you can (I think) get the drawing widget
using getNormalWidget and install your own event filter
(see QObject::installEventFilter).

-Mike
 TGS Inc, http://www.tgs.com

 
 
 

Mouse move and mouse enter Events

Post by Marcus Sinderma » Fri, 27 Jun 2003 22:12:52



> Hmm, you're right, mouse move events are only passed to the
> callback when a mouse button is pressed.  However the event
> filter in SoQtGLWidget looks like it is always forwarding
> mouse move events (when it gets them), so possibly this is
> a Qt behavior.  We will have to investigate.

> As a work-around you can (I think) get the drawing widget
> using getNormalWidget and install your own event filter
> (see QObject::installEventFilter).

I tried your suggestion. Now I can get MouseEnter and MouseLeave events
but still no MouseMove.
Any other ideas?

Bye Marcus

 
 
 

1. GLUT 1) event scheduling 2) mouse moved events in IRIX

Two GLUT related questions. I am working on a program that views 2d
planes of a 3d volume of information. Left and right arrow keys move the
current plane up and down and x/y/z determine the orientation of the
plane in the volume. There is also a way to edit the values in the plane
with the mouse, by clicking and dragging. Pretty basic stuff. I am
developing on Linux, compiling on IRIX, Linux, and eventually Sun. The
app also uses a tcl/tk interface.

I wrote a prototype app using GLUT for speed measuring purposes. The app
just kept track of the current plane and, on the display callback, drew
the plane's values to the window. It was very fast, and holding down the
left and right arrow keys gave me very smooth movement. I even put in a
sample tcl/tk interface because I was worried about the latency in
calling tcl/tk's event handler from the GLUT idle callback, but the
slowdown was negligible and the speed was still very smooth.

Now I am cleaning up the final version. I developed a base GLUT window
class that takes GLUT events, fills out a custom event struct, and
passes the event up to a custom event handler. I did this because I
liked the idea of having a single event handling function. My event
class looks something like this:

struct Event {
        tEventType type;
        tPoint2n   where;
        tModifiers modifiers;
...

So the draw callback news an event, sets the type to DrawEvent, and
passes it up. The other events do the same, filling out the relevant
data. The custon event handler then handles the event as it did in the prototype.

With one difference. The update speed while holding down the left/right
arrow keys seems to be about 4-10x slower. In the prototype, I was
getting one display callback for every key callback, so it was drawing
the screen every key. Now, I only get a display calback for every 4-10
key callbacks, so while it isn't drawing any slower, the overall effect
is that the framerate is slower.

I was thinking the extra latency might have to do with all the extra
work I'm doing in callbacks, newing and deleting the event struct and
making a few extra function calls. Does the key event have some kind of
precendece over display events, and I am just over the threshold now? Is
there a way to deal with this other than taking out the extra overhead
in the callbacks?

My second question may be related. One the IRIX build, I am not getting
any mouse moved (active, not passive) callbacks. I get the first mouse
down callback and the mouse up, but not the mouse moved events. It's
fine on the Linux builds. Any ideas?

Thanks in advance for any help.

2. Lightwave sux bigtime !!

3. Determine mouse events regardless of mouse position within form controls

4. HELP: Understanding .FLI files

5. Fast way to find to which poligon a point belongs.(mouse move -> mouse Enter)

6. shadowcasting

7. The mouse move make graphic data move

8. Recommend Fractal generator please!? Images able to be imagesett

9. Mouse Enter/Leave

10. How to simulate X mouse events in a Motif

11. Getting all mouse events?

12. Mouse Events with GLwMDrawingArea

13. ! Q: Using external events as mouse button replacement !