View Issue Details

IDProjectCategoryView StatusLast Update
0000607FreeCADBugpublic2012-02-25 11:49
ReporterveikolippandAssigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version0.12 
Target VersionFixed in Version0.13 
Summary0000607: Holding down middle mouse button (wheel) will zoom out without scrolling
DescriptionIt happens very often in every view (2D and 3D) and not only with one mouse but at least two different I have tested, where one is brand new. Same issue on Windows 7 (64bit) and Ubuntu 10.10 (64 bit) linux
There is no such behaviour with Blender3d for example so it must be bug in FreeCAD.
There is no help with changing 3D navigation mode in preferences.
TagsNo tags attached.

Activities

ryback08

2012-02-18 22:34

reporter   ~0001639

I note the same bug

wmayer

2012-02-20 19:35

administrator   ~0001643

Which navigation style do you use? Note, for Inventor navigation you can zoom by pressing CTRL+MMB and move mouse.

This is an alternative way of zooming and is not shown in the description page.

veikolippand

2012-02-22 08:04

reporter   ~0001644

Yes Inventor navigation has different buttons set for navigation but they are good for presentation not very comfortable for creating something.

wmayer

2012-02-22 09:15

administrator   ~0001645

The zooming might happen if you have accidently pressed the CTRL button (probably for selection and didn't release it) and the MMB. If this happens you should also see the cursor which looks like this <==> but rotated around 90 degree.

Please check this and let me know if you still consider this as bug.

Yes, the Inventor navigation is less comfortable for creating something but therefore you can use CAD or Blender style.

veikolippand

2012-02-22 10:46

reporter   ~0001646

Zooming happens every time I scroll the wheel no matter what navigation mode I have activated which is ok like this. But when I press middle (wheel) button then it for some reason reads out signal from wheel scrolling which is not correct. There can be one "turning click" from wheel when I press it but for FreeCAD it looks like continuous scrolling.
Also I tried it with very old Logitech usb mouse and it worked quite ok. So I don't know can it be that there is drivers issue behind this bug to generate continuous wheel movement event when wheel is in the middle of turning point or something. But i dont have this issue other 3D softwares I'm using. Can you tell me in which part in source code is implemented 3D view mouse events, maybe I can take a quick look and generate some ideas.

ryback08

2012-02-22 17:05

reporter   ~0001647

Logitech USB mouse (MX400 M-BZ105A)

On linux mint, 64bit, FreeCAD 0.13 5075

Open Freecad -> New document -> Part -> Make box.
I don't change visualisation (CAD by default)
When a press middle mouse boutton (wheel), Visualisation zoom out
I change visualisation (Blender), i press middle mouse, Same bug


I test on windows 7 32bit, FreeCAD 0.12
I don't have this bug

wmayer

2012-02-22 17:58

administrator   ~0001648

Very strange! I cannot reproduce this behaviour.

veikolippand

2012-02-22 19:01

reporter   ~0001649

I'm starting to believe it is more Logitech bug than FreeCAD as I have here two identical Logitech M505 mouses and they both behaves like mentioned in first post. Also I collected all my old mouses I could find, one Defender PS2 mouse and one Samsung USB and they worked correctly more or less. There was no zooming issue with those old mouses.
During this testing I found something else as well. When I was rotating my part suddenly my object lost his origin (if I may use such terminology). Part started to rotate around big circle not around himself. And I managed to reproduce it only once after that so who knows what it was.

veikolippand

2012-02-22 19:08

reporter   ~0001650

Last edited: 2012-02-23 06:19

aaah ok I think I found it! these Logitech mouses have three bush buttons underneath wheel. I suspect when I press on wheel it for some reason presses down one or who knows maybe both these left<->right buttons and there it is. If you now can remove or elliminate these button presses from middle mouse press signal then it should be ok and FreeCAD have more happy users :)

edit: I meant "push button" :) not "bush button"

ryback08

2012-02-22 20:56

reporter   ~0001651

Last edited: 2012-02-22 21:14

I'm get to the same conclusion, isn't FreeCAD bug, it is my Logitech mouse (or mouse driver)

I instal btnx ( http://doc.ubuntu-fr.org/btnx ) to manage mouse on linux
and I didn't try to detect correctly middle mouse. when i push on middle mouse, btnx detect 2 different push.

#### edit #####
I reconfirm, is it logitech mouse, another person has same bug with blender
post (French, sorry) http://forum.ubuntu-fr.org/viewtopic.php?id=293183

veikolippand

2012-02-23 06:17

reporter   ~0001652

I don't understand french but I understand that there was issue with old Blender version and I can say that since Blender 2.5 I have no single issue with mouse buttons. This means if they had problem then they found solution for it. We need same kind of solution for FreeCAD.

wmayer

2012-02-23 10:21

administrator   ~0001653

The question is what's happening on OS-side when pressing by accident these mouse buttons.
In FreeCAD the event processing works like this:

1. OS notifies the application that an event was emitted
2. Our toolkit library Qt receives this event and converts it into the Qt-own class
3. Qt sends this event to the active widget and this either processes the event or sends it to its children
4. At some point the event is sent to the widget which contains the 3D Inventor viewer
5. There SoQt converts the Qt event into a Coin event
6. The navigation style gets the Coin event and either processes it or send it to the scene graph.

The main question is as what these two buttons are handled. I guess the OS already handles them as scroll up/down events and thus we have no chance of filtering.

So, what happens if you only press one of these buttons?

veikolippand

2012-02-23 12:31

reporter   ~0001654

Last edited: 2012-02-23 12:37

I tested as much I could and on Ubuntu 10.10 64 bit:
I built application based on direct XLIB commands to get as close as possible and my logitech mouse buttons are in this order from XLib output:
button 1 - left button
button 2 - middle button
button 3 - right button
button 4 - wheel forward
button 5 - wheel backward
button 6 - wheel left
button 7 - wheel right

I tried to goolge about Qt and mouse buttons and closest I got was that Qt 5 supports more mouse buttons.

Currently these two (left/right) buttons act like mouse wheel scroll in FreeCAD.

veikolippand

2012-02-23 13:08

reporter   ~0001655

Last edited: 2012-02-23 13:24

Ok I found this kind of solution and it seems to work on Qt 4.7.4

void MainWindow::wheelEvent(QWheelEvent * event)
{
    event->orientation() == Qt::Vertical ?
    (event->delta()>0 ? ui->label->setText("ScrollUp") : ui->label->setText("ScrollDown")) :
    (event->delta()>0 ? ui->label->setText("ScrollLeft") : ui->label->setText("Scrollright"));
}

edit: It's not only seems but really working on Qt 4.7.4, I tested.

wmayer

2012-02-23 19:33

administrator   ~0001656

Hmm, but this code snippet only shows what the incoming wheel event is. So, apparently the two buttons cause a ScrollLeft and ScrollRight. It seems that SoQt ignores the orientation and only checks the delta.

So, how should we proceed with this now? Do you want to filter out all wheel events which orientation is Qt::Vertical?

And before continuing on this I already have checked-in a change that might work, too. Before doing the zoom I check if the MMB is pressed and if so I simply do nothing. Can you check this with the next PPA version if it's OK for you, please?

veikolippand

2012-02-24 06:23

reporter   ~0001657

Last edited: 2012-02-24 08:09

I don't know much about SoQt but if you have possibility to grab QEvent then you can cast it to QWheelEvent and then you have all you need to handle those wheel events separately from each other. And you can implement something useful for left<->right buttons as well. :)

void someObject::mouseEvent(QEvent *event)
{
 if(event::wheel)
 {
    QWheelEvent *wheelEvent = dynamic_cast<QWheelEvent*>(event);
    if(wheelEvent->orientation() == Qt::Vertical)
    {
        ///scroll up happened
    }
    else
    {
        //wheel left/right buttons pressed
    }
 }
}

But as I said I don't know about SoQt so maybe this solution is not working if event pointer is modified somewhere by SoQt.
And I will keep eye on next version as I desperately need 3D cad tool for my hobby projects.

wmayer

2012-02-24 09:12

administrator   ~0001658

I have added a fix now which looks like this:
void View3DInventorViewer::processEvent(QEvent * event)
{
    if (event->type() == QEvent::Wheel) {
        QWheelEvent* we = static_cast<QWheelEvent*>(event);
        if (we->orientation() == Qt::Horizontal)
            return;
    }
...
}

So, I filter out all horizontal scroll events. I hope this solves the issue now.

And I also looked at the SoQt code. As I assumed there only the delta is checked but not the orientation.

veikolippand

2012-02-25 11:15

reporter   ~0001659

Tested it and it is fixed now in 0.13 (from GIT).

wmayer

2012-02-25 11:49

administrator   ~0001660

Fixed in git 614e0442d74a79f886b05683eae0910c43b5229b

Issue History

Date Modified Username Field Change
2012-02-16 19:06 veikolippand New Issue
2012-02-18 22:34 ryback08 Note Added: 0001639
2012-02-20 19:35 wmayer Note Added: 0001643
2012-02-22 08:04 veikolippand Note Added: 0001644
2012-02-22 09:15 wmayer Note Added: 0001645
2012-02-22 10:46 veikolippand Note Added: 0001646
2012-02-22 17:05 ryback08 Note Added: 0001647
2012-02-22 17:58 wmayer Note Added: 0001648
2012-02-22 19:01 veikolippand Note Added: 0001649
2012-02-22 19:08 veikolippand Note Added: 0001650
2012-02-22 20:56 ryback08 Note Added: 0001651
2012-02-22 21:14 ryback08 Note Edited: 0001651
2012-02-23 06:17 veikolippand Note Added: 0001652
2012-02-23 06:19 veikolippand Note Edited: 0001650
2012-02-23 10:21 wmayer Note Added: 0001653
2012-02-23 12:31 veikolippand Note Added: 0001654
2012-02-23 12:36 veikolippand Note Edited: 0001654
2012-02-23 12:37 veikolippand Note Edited: 0001654
2012-02-23 13:08 veikolippand Note Added: 0001655
2012-02-23 13:24 veikolippand Note Edited: 0001655
2012-02-23 19:33 wmayer Note Added: 0001656
2012-02-24 06:23 veikolippand Note Added: 0001657
2012-02-24 08:09 veikolippand Note Edited: 0001657
2012-02-24 09:12 wmayer Note Added: 0001658
2012-02-25 11:15 veikolippand Note Added: 0001659
2012-02-25 11:49 wmayer Note Added: 0001660
2012-02-25 11:49 wmayer Status new => closed
2012-02-25 11:49 wmayer Resolution open => fixed
2012-02-25 11:49 wmayer Fixed in Version => 0.13