Page 1 of 1

mouse scroll wheel doesn't work, SDL2

Posted: Fri Jun 10, 2016 12:43 am
by filbo
This has been true "forever", but I'm reporting it specifically in latest "RC2"-labeled git code.

Main menu => Level Creator; mouse over the playfield or the drawing elements palette; operate scroll wheel; mouse over playfield, hold down Shift + operate scroll wheel.

Expected: playfield or drawing elements palette scrolls up or down; playfield scrolls horizontally.

Actual: in SDL1 build, works fine; in SDL2 build, nothing happens.

"HMMM", I thought, "it must be this code in src/events.c, somehow getting wrong signals from SDL2:"

Code: Select all

  /* do not use scroll wheel button events for anything other than gadgets */
  if (IS_WHEEL_BUTTON(button_nr))
    return;
-- commented it out -- makes no difference. Sigh.

Re: mouse scroll wheel doesn't work, SDL2

Posted: Tue Jun 14, 2016 3:14 pm
by Holger
Thanks for reminding me about this!

It's fixed now in the latest version in the Git repo, and should work as in SDL1.

One (hopefully) slight improvement: It now supports accelerated mouse wheel actions on platforms that support it (which is currently Mac OS X (tested, and really works nicely) and (probably) Windows (not tested), but unfortunately not Linux, which apparently does not support it on system/driver level -- here we have a default of jumping three lines/tiles per single wheel move, which can be reduced to one line/tile by holding down the "Alt" key, for more precise control).

Re: mouse scroll wheel doesn't work, SDL2

Posted: Thu Jun 16, 2016 12:06 pm
by filbo
Confirming: scroll wheel now works under SDL2. (And still works under SDL1.)

I have not noticed the lack of acceleration, or a need for it...

One small tweak that would be nice: some programs or environments will scroll horizontally if you operate the scroll wheel while pointing at the horizontal scroll bar. I am apparently used to this behavior, as I keep noticing myself trying to do it in the RnD level editor...

Re: mouse scroll wheel doesn't work, SDL2

Posted: Fri Jun 17, 2016 6:44 pm
by Holger
I have not noticed the lack of acceleration, or a need for it...
If you have used it once, you will miss it if it's not there. :-)

It really feels "natural", as you can move the mouse wheel very slowly to scroll very precisely line by line (or tile by tile in the editor) with every single "click" of the mouse wheel (not meaning pressing it as a middle mouse button, but the "click" it makes for each minimal wheel movement). But you can also give it a fast spin, moving through the whole list of elements in the "editor element palette" with only a few moves of your finger. I got instantly used to it on a Mac, and now it does not "feel right" anymore when I use a wheel mouse with Linux. :-|
One small tweak that would be nice: some programs or environments will scroll horizontally if you operate the scroll wheel while pointing at the horizontal scroll bar. I am apparently used to this behavior, as I keep noticing myself trying to do it in the RnD level editor...
Sounds very reasonable indeed. And this was also extremely easy to add. Please "git pull" and have a look at it.

Re: mouse scroll wheel doesn't work, SDL2

Posted: Fri Jun 17, 2016 11:16 pm
by filbo
Works beautifully, SDL1 & SDL2. Thanks!