Author Topic: Strange mouse wheel results  (Read 332 times)

Offline Ophelius

  • Newbie
  • Posts: 15
Strange mouse wheel results
« on: August 12, 2020, 08:21:38 PM »
The mouse wheel doesn't work until at least 3 consecutive clicks up or down has been registered, then it works fine after each click in the same direction. If you change direction, it then takes another 3 clicks in that direction to get it started. If you go back and forth between up and down never clicking more than 2, it'll never register a wheel click. Example, this sequence won't cause any click: go up 2, down 2, up 1, down 1, up 2, down 1, up 2, down 2...this will never scroll the wheel. But as soon as you hit that 3rd click in the same direction it works in that direction every click.

I tried the simplest example in the help, same problem:
Code: QB64: [Select]
  1. DO: _LIMIT 100
  2.         Scroll = Scroll + _MOUSEWHEEL
  3.         LOCATE 10, 20: PRINT Scroll
  4.     LOOP
  5. LOOP UNTIL INKEY$ = CHR$(13) ' press Enter to quit
  6.  

It's not my mouse, the scrolling works fine everywhere else in Windows.

Any idea?

Online FellippeHeitor

  • QB64 Developer
  • Forum Resident
  • Posts: 2411
  • LET IT = BE
    • QB64.org
Re: Strange mouse wheel results
« Reply #1 on: August 12, 2020, 08:23:02 PM »
Does this make a difference?

Code: QB64: [Select]
  1. DO: _LIMIT 100
  2.         Scroll = Scroll + _MOUSEWHEEL
  3.     LOOP
  4.     LOCATE 10, 20: PRINT Scroll
  5.     _DISPLAY
  6. LOOP UNTIL INKEY$ = CHR$(13) ' press Enter to quit
  7.  

Offline Ophelius

  • Newbie
  • Posts: 15
Re: Strange mouse wheel results
« Reply #2 on: August 12, 2020, 08:32:13 PM »
Does this make a difference?

Code: QB64: [Select]
  1. DO: _LIMIT 100
  2.         Scroll = Scroll + _MOUSEWHEEL
  3.     LOOP
  4.     LOCATE 10, 20: PRINT Scroll
  5.     _DISPLAY
  6. LOOP UNTIL INKEY$ = CHR$(13) ' press Enter to quit
  7.  


No, same thing. One thing to note is the 1st scroll after the program starts takes 2 clicks to get going, not 3. But then it's back to 3 when changing directions as stated above

Offline Cobalt

  • Forum Resident
  • Posts: 660
  • At 60 I become highly radioactive!
Re: Strange mouse wheel results
« Reply #3 on: August 15, 2020, 02:57:54 PM »
Does pretty much the same thing for me when trying to scroll through code in the IDE. 1 or 2 click delay before things start happening, but it also does this in most games I play that make use of the scroll wheel. I always thought that was intended behavior or hardware behavior just in case the user bumped the scroll wheel so they did get constant jittering around.
Granted after becoming radioactive I only have a half-life!

Offline Ophelius

  • Newbie
  • Posts: 15
Re: Strange mouse wheel results
« Reply #4 on: August 15, 2020, 03:07:05 PM »
Does pretty much the same thing for me when trying to scroll through code in the IDE. 1 or 2 click delay before things start happening, but it also does this in most games I play that make use of the scroll wheel. I always thought that was intended behavior or hardware behavior just in case the user bumped the scroll wheel so they did get constant jittering around.

Good that it's not just me. I've never seen behavior like that in any other game or software. It's a tad annoying in my opinion that the QB64 IDE does this, and also anything compiled with QB64 will do this. The mouse wheel should respond the 1st scroll click you make. It does seem like an internal counter is counting. No matter how slow you click, when that counter counts to 3 it allows clicks in that direction, and resets itself when changing direction.

Devs: Is this intentional? Is this a feature programmed into QB or is this a possible bug?
« Last Edit: August 15, 2020, 03:08:39 PM by Ophelius »

Offline OldMoses

  • Seasoned Forum Regular
  • Posts: 357
Re: Strange mouse wheel results
« Reply #5 on: August 15, 2020, 05:24:37 PM »
I get the same behaviour, but I don't think it's the fault of QB64. I've seen it in other applications. My money is on the OS, or hardware. I'm using a Logitech M510 wireless, which has been dropped on the floor at least a couple times a day. I've never really looked into trying to fix it, just figured it was normal.
Andy

Offline Ophelius

  • Newbie
  • Posts: 15
Re: Strange mouse wheel results
« Reply #6 on: August 15, 2020, 05:45:23 PM »
I get the same behaviour, but I don't think it's the fault of QB64. I've seen it in other applications. My money is on the OS, or hardware. I'm using a Logitech M510 wireless, which has been dropped on the floor at least a couple times a day. I've never really looked into trying to fix it, just figured it was normal.

Hmm, that's weird. I tried it on 2 different mice, same thing, and I've never experienced this other than with the Qb64 editor and programs compiled with it

Offline OldMoses

  • Seasoned Forum Regular
  • Posts: 357
Re: Strange mouse wheel results
« Reply #7 on: September 13, 2020, 08:39:05 AM »
Revisiting this, I stand corrected from my earlier post, I note that in working on my star system simulator application the effect that never bugged me before, becomes more pronounced when you have occasion to use the wheel for fine control.

I recently added a mouse wheel zooming capability, whereby rolling the mouse one direction zooms in, while rolling the other way zooms out. Similar to applications such as various CAD aps and Blender. Additionally, clicking the mouse wheel returns to a default zoom factor. Each detent of the mouse wheel, or what I'll refer to as a "roll click", results in a halving or doubling of the zoom factor. Here is where the mouse action becomes most noticeable.

As Ophelius noted earlier, the precise behaviour seems to be that rolling the mouse wheel in one direction will yield the desired results. You can stop and then continue without any issues. However, reversing the mouse wheel direction will result in two "dry roll clicks" of the wheel, where nothing will happen in the application, and the desired effect will start on the third "roll click". Clicking the wheel as you would a button doesn't reset the behaviour in any way. For some reason QB64 chooses to ignore two wheel detents upon reversal.

I never thought much of it before, as it wasn't as noticeable in the IDE, given that I was rapidly rolling the wheel through large blocks of code and never had occasion for finer control.

I went to a Blender project I'm working on and it would not duplicate the effect, so it's obviously not a hardware or OS issue, unless its associated with certain individual systems and their interaction with the IDE. QB64 and its compiled applications seems to consistently lose two mouse wheel detents when reversing the wheel.
« Last Edit: September 13, 2020, 08:45:45 AM by OldMoses »
Andy

Offline RhoSigma

  • Seasoned Forum Regular
  • Posts: 394
  • Palaualelo i kēia manawa.
Re: Strange mouse wheel results
« Reply #8 on: September 13, 2020, 09:27:12 AM »
I've noticed this behavior a good while ago when implementing wheel actions into GuiTools, eg. to move scroll bars, sliders, listviews etc.. I fully agree it must be a fault of QB64, or more specific the OpenGL mouse routines used, because with the old SDL based QB64 versions there's no such click delay when reversing the scroll direction. It works as expected from the first wheel click in old QB64 SDL (v0.954), so it's definitly something introduced with the transition to OpenGL between versions 0.954 and 1.000.
Interested in my QB64 Stuff?
GuiTools Framework, Blankers, QB64/Notepad++ setup ...
Libraries (MD5/SHA2 hashing, DES56 encryption, LZW packer, File/Data buffers, Image processing, C++ stdlib wrappers and more)
see here: https://www.qb64.org/forum/index.php?topic=809.msg100182#msg100182

Offline bplus

  • Forum Resident
  • Posts: 5300
  • B+ Knot again!
Re: Strange mouse wheel results
« Reply #9 on: September 13, 2020, 11:54:38 AM »
I swear I hear an echo from a month or two ago when all were befuddled by an extra click needed for the mouse wheel.

You guys are so sensitive ;-))

Offline OldMoses

  • Seasoned Forum Regular
  • Posts: 357
Re: Strange mouse wheel results
« Reply #10 on: September 13, 2020, 05:40:06 PM »
I swear I hear an echo from a month or two ago when all were befuddled by an extra click needed for the mouse wheel.

You guys are so sensitive ;-))

You should see me when I get a pebble in my shoe...;)
Andy

Offline TempodiBasic

  • Forum Resident
  • Posts: 1513
Re: Strange mouse wheel results
« Reply #11 on: September 13, 2020, 08:34:31 PM »
Hi
about
Quote
QB64 and its compiled applications seems to consistently lose two mouse wheel detents when reversing the wheel.
yes also I experiment this. But I use massively mouse wheel with no one movement at a time, so I have had no issue from this loose of 2-3 click in the reverse of mousewheel.  Surely in a more sensitive system for an accurate action of mouse, this 2-3 click of mousewheel must be managed to avoid different reaction of program to the action of rotating mousewheel.
However looking at Panel Control of Windows, in the section Mouse you can see that for default the mousewheel has its settings in which in my PC appears a number 3.... is it important for the issue talked here?
Programming isn't difficult, only it's  consuming time and coffee