Latest Posts

Topic: More uses for mousewheel / touchpad scrolling

tothxa
Avatar
Topic Opener
Joined: 2021-03-24, 11:44
Posts: 437
OS: antix / Debian
Version: some new PR I'm testing
Ranking
Tribe Member
Posted at: 2021-07-23, 13:32

I'd like to ask for comments for the following ideas and my implementation steps so far.

I implemented map movement with mouse wheel as a test, because right drag (2 finger tap and drag) does not work on my current laptop's touchpad, and scrolling with 2 finger drag is easier anyway. I think it works fine, but it needs to be configurable, and cooperate with the setting for mousewheel zooming. But if I start working on that, it would make sense to also add other uses for scrolling. This would make playing with a touchpad on a laptop much more comfortable.

As the next step, I added changing the game speed with (ctrl-)horizontal scrolling. It works, but my attempt at preventing diagonal scroll failed (every "wheel" tick creates a separate event — but at least there seems to be some directional filtering in the touchpad driver). This is the current state of the code at https://github.com/tothxa/widelands/tree/mousewheel

Then I tried to gather current and possible new uses for scrolling. Current:

  • multilinetextarea and list selection: no need for config, but should ignore wheel with modifier key to allow other uses
  • tabpanel: has an open bug (#4812): I'd add ctrl- for this by default (still a conflict with zoom, but that's less of a problem, while consistent with ctrl-tab and ctrl-num that was merged recently), an make it configurable, so people with touchpad (or 2-wheel mouses, if those still exist) can change it to e.g. ctrl-horiz scroll (or whatever they like, see later) ­— this would also help in the editor when the terrain/immovable/animal windows are open

New:

  • map movement (see above)
  • game speed (see above)
  • spinbox and similar, like ware amounts and priorities in building (could be horiz-vert on touchpad) and number of soldiers in military site or to attack
  • editor tool size
  • (editor:) item selection in the terrain/immovable/animal windows

With at least some of the above implemented, it would make sense to create a whole new config window (like key bindings). I think it would be best arranged in a matrix with all modifiers and all uses.

My first idea was to use radio buttons, but it could be useful to allow handling vertical and horizontal scrolling separately (there are not that many modifiers), while at least map movement needs both… also some are in-game, some editor and some both… so radiobutton or not, it probably needs a lot of special handling…

And probably most (all?) uses should have their own option to invert direction too.


Top Quote
tothxa
Avatar
Topic Opener
Joined: 2021-03-24, 11:44
Posts: 437
OS: antix / Debian
Version: some new PR I'm testing
Ranking
Tribe Member
Posted at: 2021-07-30, 15:57

OK, then a simpler question: Can I get this merged if I finish it?

(should I have opened an under discussion issue on github instead of using the forum?)


Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 17:07
Posts: 1950
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2021-07-30, 16:57

This thread seems to have gotten overlooked…

tothxa wrote:

I'd like to ask for comments for the following ideas and my implementation steps so far.

I implemented map movement with mouse wheel as a test, because right drag (2 finger tap and drag) does not work on my current laptop's touchpad, and scrolling with 2 finger drag is easier anyway. I think it works fine, but it needs to be configurable, and cooperate with the setting for mousewheel zooming. But if I start working on that, it would make sense to also add other uses for scrolling. This would make playing with a touchpad on a laptop much more comfortable.

As the next step, I added changing the game speed with (ctrl-)horizontal scrolling. It works, but my attempt at preventing diagonal scroll failed (every "wheel" tick creates a separate event — but at least there seems to be some directional filtering in the touchpad driver). This is the current state of the code at https://github.com/tothxa/widelands/tree/mousewheel

+1 sounds cool face-smile.png

Then I tried to gather current and possible new uses for scrolling. Current:

  • multilinetextarea and list selection: no need for config, but should ignore wheel with modifier key to allow other uses
  • tabpanel: has an open bug (#4812): I'd add ctrl- for this by default (still a conflict with zoom, but that's less of a problem, while consistent with ctrl-tab and ctrl-num that was merged recently), an make it configurable, so people with touchpad (or 2-wheel mouses, if those still exist) can change it to e.g. ctrl-horiz scroll (or whatever they like, see later) ­— this would also help in the editor when the terrain/immovable/animal windows are open

When a UI accessibility feature is triggered by a keypress, adding modifiers does no harm since you have to use the keyboard anyway. But changing a mouse-only access feature to a mouse-and-key combination makes it harder to use. So -1 for requiring Ctrl for scrolling through tabs with the mousewheel as this makes the feature useless.

New:

  • map movement (see above)
  • game speed (see above)
  • spinbox and similar, like ware amounts and priorities in building (could be horiz-vert on touchpad) and number of soldiers in military site or to attack
  • editor tool size
  • (editor:) item selection in the terrain/immovable/animal windows

+1

With at least some of the above implemented, it would make sense to create a whole new config window (like key bindings). I think it would be best arranged in a matrix with all modifiers and all uses.

My first idea was to use radio buttons, but it could be useful to allow handling vertical and horizontal scrolling separately (there are not that many modifiers), while at least map movement needs both… also some are in-game, some editor and some both… so radiobutton or not, it probably needs a lot of special handling…

And probably most (all?) uses should have their own option to invert direction too.

+1 for making all this configurable and invertible. A matrix might make this look cluttered and unintuitive; I guess a list, or a tab panel with a list in each tab (similar to the keybindings menu), would be better; but that's hard to say without looking at it of course


Top Quote
tothxa
Avatar
Topic Opener
Joined: 2021-03-24, 11:44
Posts: 437
OS: antix / Debian
Version: some new PR I'm testing
Ranking
Tribe Member
Posted at: 2021-07-31, 21:20

Thank you very much for the feedback.

Nordfriese wrote:

  • tabpanel: has an open bug (#4812): I'd add ctrl- for this by default

When a UI accessibility feature is triggered by a keypress, adding modifiers does no harm since you have to use the keyboard anyway. But changing a mouse-only access feature to a mouse-and-key combination makes it harder to use. So -1 for requiring Ctrl for scrolling through tabs with the mousewheel as this makes the feature useless.

OK. I'll try to do your suggestion on the bug then (only handle wheel when mouse is over the tab bar). I had a look at the panel code for handling mousein and I'm not sure I understand it though…

+1 for making all this configurable and invertible. A matrix might make this look cluttered and unintuitive; I guess a list, or a tab panel with a list in each tab (similar to the keybindings menu), would be better; but that's hard to say without looking at it of course

OK. I'll see what I can do. I'll try to make a mockup first, and come back for comments.


Top Quote