Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OSX] Moving map with scrolling touchpad #1140

Closed
DorpsGek opened this issue Aug 18, 2007 · 15 comments
Closed

[OSX] Moving map with scrolling touchpad #1140

DorpsGek opened this issue Aug 18, 2007 · 15 comments
Labels
component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

hanicka opened the ticket and wrote:

When I try to scroll map and building railway (or highway, etc) map is not scrolling. After mouseup move jump to position as I scroll.

Reported version: trunk
Operating system: Mac OS X


This issue was imported from FlySpray: https://bugs.openttd.org/task/1140
@DorpsGek
Copy link
Member Author

hanicka wrote:

It's revision 10927


This comment was imported from FlySpray: https://bugs.openttd.org/task/1140#comment1899

@DorpsGek
Copy link
Member Author

Hathor wrote:

I dont really understand how you are able to both scroll and build something ONLY with your mouse at the same time. Building takes left mouse button making the movement of the mouse the direction of the tracks to be build. Scrolling takes right mouse button making the movement change the viewport. From my point of view it is only possible to do both when you use mouse and keyboard, though I might be mistaken.


This comment was imported from FlySpray: https://bugs.openttd.org/task/1140#comment1915

@DorpsGek
Copy link
Member Author

hanicka wrote:

I don't using second button, I'm using scrolling feature of my touchpad (like apple mighty mouse), i have pressed button (only one button on apple touchpad) and scrolling use two fingers on touchpad. (My touchpad is multi touch on latest ibook G4). But game, when I building something, stop react on any scrolling event on touchpad, and after I release button, game will instantly move screen to position as I scroll during building. It's good to can scrolling when building (very long rails). This scrolling is like roling mouse roller.


This comment was imported from FlySpray: https://bugs.openttd.org/task/1140#comment1918

@DorpsGek
Copy link
Member Author

Hathor wrote:

Alright. I am not really using apple stuff nor do I have good knowledge about the games event handling, so I guess its better if some dev is giving his opinion on the matter.


This comment was imported from FlySpray: https://bugs.openttd.org/task/1140#comment1922

@DorpsGek
Copy link
Member Author

Rubidium wrote:

So these touchpad issues are basically OSX specific as I cannot reproduce them on a non-OSX operating system?


This comment was imported from FlySpray: https://bugs.openttd.org/task/1140#comment1933

@DorpsGek
Copy link
Member Author

hanicka wrote:

No, You must set Configure Patches > Function of scrollwheel > Scroll Map. And rolling with mouse wheel.


This comment was imported from FlySpray: https://bugs.openttd.org/task/1140#comment1939

@DorpsGek
Copy link
Member Author

Rubidium wrote:

It actually is OSX specific; only OSX implements that function.


This comment was imported from FlySpray: https://bugs.openttd.org/task/1140#comment1947

@DorpsGek
Copy link
Member Author

DorpsGek commented Jan 2, 2008

egladil wrote:

The events appears to be cached at os level. This I deduced by trying how other applications (TextEdit, XCode and XChat Aqua) behave when trying to scroll with the touchpad while holding the mouse button down. However, I can't find any documentation about this at all. But there seem to be a way to circumvent the caching as Firefox does not suffer from it.


This comment was imported from FlySpray: https://bugs.openttd.org/task/1140#comment3146

@DorpsGek
Copy link
Member Author

m1ss1ontomars2k4 wrote:

Zooming the map with the scroll wheel also does not work (at all) while building if that option is selected in the patches. The events do seem to get cached; this doesn't happen in any web browser that I use, Mail, or a variety of other apps, but it does happen in some apps.


This comment was imported from FlySpray: https://bugs.openttd.org/task/1140#comment6958

@DorpsGek
Copy link
Member Author

tyler wrote:

I don't think it's cached, I put some debug lines in the event handling code, the scroll wheel event is firing even while I'm dragging to build roads etc. I noticed that when the scroll wheel action is set to Zoom, scrolling while dragging doesn't cause the zoom to be delayed, it doesn't happen at all. Not really sure what it all means yet though


This comment was imported from FlySpray: https://bugs.openttd.org/task/1140#comment6959

@DorpsGek
Copy link
Member Author

tyler wrote:

I think we should decide what we want the desired behavior to be. If we want one to be able to use the scroll wheel while building, we'll have to implement that for Zoom also. If not, we should fix it so that while in Move Map mode, nothing happens when scrolling-while-building (to bring it in line with zoom). My suggestion, since only one person has reported this, two years ago, is to choose the latter option.


This comment was imported from FlySpray: https://bugs.openttd.org/task/1140#comment6976

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 1, 2010

thorvoquien wrote:

I took a look at this and think I have a fix.

Background:
OpenTTD keeps track of traditional 1 dimensional line based scrolling and 2 dimensional precision scrolling (as found in Apple trackpads, mighty mice, and magic mice) in completely different ways.

There are two issues here.
First is that the current mouse event handling code returns after handling the first event (ie drag) so it never has a chance to get to the scrolling part.

Second is that, 2D scrolling events get cached (in OpenTTD - not the OS) during other mouse events (drags, regular 1D scrolls of widgets, etc) and gets turned into one huge jump-scroll once the drag ends or the 1D scroll moves off of the widget you were scrolling.

The second issue (the actual bug part of it) can be fixed with a 2 line patch (see next comment for said patch)

The first issue isn't so much a bug as a feature request. I can see why you would want this behavior, I turn off edge of screen scrolling when I turn 2D trackpad scrolling on because its annoying and as a result have no way to scroll while dragging. It could probably be done pretty easily by checking, early in the MouseLoop handler whether there are queued v_wheel/h_wheel values and scrolling the viewport there before continuing to the actual event.

Tyler is definitely right though that we need to consider carefully what the desired behavior should be. I don't think it makes as much sense to be able to zoom while laying track? I think there might be some situations where you would want 2D pad scroll + dragging and some that you wouldn't. Should it be a config option or a separate gesture?

I also discovered a few other quirks with the precision 2D scrolling devices. They aren't really bugs, so much as not using the hardware to its full advantage. In particular there is a quirk on the magic mouse where accelerated scrolling continues for a little bit afterwards even if you use the above patch to clear all cached events before you start a 2D scroll. In general all the precision 2D scrolling devices can give us delta values in pixels rather than lines which would make scrolling with these devices much smoother.

I am going to continue looking into improving the support for the optional features of these scrolling devices, what is the best way to go about getting the fix for the 2D scrolling cache bug tested/reviewed/committed?


This comment was imported from FlySpray: https://bugs.openttd.org/task/1140#comment7506

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 1, 2010

thorvoquien wrote:

Here is a diff of my 2D scrolling fix patch against the latest nightly

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/1140#comment7507

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 4, 2010

Rubidium wrote:

That patch is applied in 19002.


This comment was imported from FlySpray: https://bugs.openttd.org/task/1140#comment7520

@DorpsGek
Copy link
Member Author

andythenorth closed the ticket.

Reason for closing: Implemented

Rubidium indicates in comments that there is a fix in place for this.


This comment was imported from FlySpray: https://bugs.openttd.org/task/1140

@DorpsGek DorpsGek added component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) enhancement labels Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant