Patch: Left click scrolling

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

illogict
Engineer
Engineer
Posts: 12
Joined: 27 Jul 2005 14:24
Location: Évry (France)
Contact:

Patch: Left click scrolling

Post by illogict »

Hello!

As part as my porting effort of OpenTTD to Maemo devices, here is a patch to enable left-click scrolling. Thanks to it, scrolling is now a breeze on touch-screen devices, and is also made easier to laptop users using a touchpad (and not to forget also Mac users).
To use it, you only need to press the left-mouse button anywhere on the map that does not have something that will popup information, and move the mouse. Release the button when you are done.
Patch has been made against latest SVN (r11993).

Comments are of course welcomed, and please don't be too harsh for my first post on this forum and my first patch :D
Attachments
openttd-left_scrolling.patch
Patch to enable left-click scrolling
(9.35 KiB) Downloaded 210 times
Image
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Patch: Left click scrolling

Post by Bilbo »

This may be good for those touch screens and perhaps not only for touch screens, other people may perhaps like it too.

But I think you should add some way to turn this feature on and off in the settings. Some people may not like that the scrolling could interfere with their ordinary left mouse button usage ...
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2830
Joined: 16 May 2007 16:59

Re: Patch: Left click scrolling

Post by Zephyris »

Excellent, now I can use my wacom to play! I have vista, so I can't use buildottd to test it, so a couple of questions:
Does the mouse cursor move when you drag the map - ie. is it a "grab and pull" feeling?
Does it/could it use additional cursors to show mouse function? A hand and a closed hand would make it more intuative...

And I would say it definitely needs a switch...
bokkie
Transport Coordinator
Transport Coordinator
Posts: 327
Joined: 19 Jan 2007 19:26

Re: Patch: Left click scrolling

Post by bokkie »

Binaries, specially for Zephyris for his hard work on the graphic replacement set ;) :
Attachments
trunk_r11993_openttd-left_scrolling.patch_28-1-2008_13-35-08.rar
(2.4 MiB) Downloaded 130 times
elf_sander
Engineer
Engineer
Posts: 26
Joined: 12 Sep 2005 15:35
Location: Nederland
Contact:

Re: Patch: Left click scrolling

Post by elf_sander »

Maybe this would be a nice patch for the DS port that is beïng developped.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4552
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Patch: Left click scrolling

Post by Zuu »

Very nice!

I'm a wacom-user too.. I actually made a similar patch myself where I used middle mouse button instead. To do so I had to make changes in the SDL-driver as OpenTTD is not generally aware of middle clicks. My intention was never to make it to trunk unless there where a demand and with no replies to my thread I did not made any effort to make it accepted in trunk.

Please consider to both use X and Y axis as for some devices X is easier to use and for some other Y might be easier to use.


Edit:
Zephyris wrote:Does the mouse cursor move when you drag the map - ie. is it a "grab and pull" feeling?
For absolute devices such as wacom (in absolute mode) you can not possible not move the cursor if the pen is moved. Yes you can call an API function in SDL or DirectX to swap the cursor to another position on the screen, but immediately it will be moved back since the input device use absolute addressing. What you can do is to hide the mouse cursor. But for relative input devices such as the touch area on a laptop you could force the pointer to stay on the same position though.
Zephyris wrote:Does it/could it use additional cursors to show mouse function? A hand and a closed hand would make it more intuative...
Um, are we thinking about the same kind of scrolling as in what would happen if you used the scroll wheel on a input device that has that. Because for scrolling in the sense of zooming the map I think the hand sends the wrong signals. A hand more tells the user that it will grab the map and move it, not zoom. At least in my world, but our views might differ.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
illogict
Engineer
Engineer
Posts: 12
Joined: 27 Jul 2005 14:24
Location: Évry (France)
Contact:

Re: Patch: Left click scrolling

Post by illogict »

Here, by scrolling, I really meant scrolling, not zooming, like the right click-scrolling implemented in OpenTTD.
I'm currently making an updated version of the patch, that will take into account all comments, and also work betting with touchscreens.
Thank you for all your comments!
Image
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: Patch: Left click scrolling

Post by FooBar »

I just tried the patch, and I like it :D

I don't think a 'grab and pull' feature is useful: you'd grab the map in one edge, move the mouse to the other edge. Right then your cursor ended up at the opposite edge, so you'd have to move it back to the original edge and repeat.
This wouldn't be too much of a problem for touch-screen devices, but would render the function useless for a laptop's touchpad.
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Re: Patch: Left click scrolling

Post by Bjarni »

Bilbo wrote:But I think you should add some way to turn this feature on and off in the settings. Some people may not like that the scrolling could interfere with their ordinary left mouse button usage ...
This is a must. I would hate to get "random" scrolls. Unlike popular believes a fair amount of macs has multibutton mice. The exception are MacBooks/PowerBooks but they can use two finger scrolling instead.
As for the feature itself I can imagine that it can be rather good for certain devices. A Maemo port sounds nice. Maybe you will even be so nice (to yourself and other Maemo users) not to run away when the port is half working like the last porter :?
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2830
Joined: 16 May 2007 16:59

Re: Patch: Left click scrolling

Post by Zephyris »

It needs to be a grab and pull method, otherwise it is very hard to use with wacom tablets etc... Have you actually tried it with one of these devices?

This is because when the of the way the map movement is determined from mouse position. It currently uses the "first person shooter method" - the mouse is moved, the relative movement logged, and the mouse cursor reset to its original location. This does not work for absolute positioning devices such as touch screens and wacom tablets. The symptom of this is the scrolling is almost uncontrollable, and you have to put the pointing device precisely back to where it started to stop map movement.

Devices your patch will work with (relative mouse movement):
Mouse
Laptop touchpad
Tracking ball

Devices it won't (absolute mouse positioning):
Wacom
Touch screen

*edit* I have tried it out more and it seems this is not quite the symptoms seen, it is just lurchy and really oversensitive!
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4552
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Patch: Left click scrolling

Post by Zuu »

Zephyris wrote:*edit* I have tried it out more and it seems this is not quite the symptoms seen, it is just lurchy and really oversensitive!
I also tested it and for me it is just as sensitive as when I am paning the map with the "right mouse button" on my pen. Personally I like how sensitive it is and how it work more like a joystick. But the new left-button paning do slow down and eventually comes to a stop. The slow down is as you mentioned far from smooth. When right-button-paning I would keep my pen tip within a one centimeter from the orgin when moving fast and even closer when moving slow. (I have an A5 Itous second generation.)

But for a touch screen the sensitiveness of the paning is probably way to high since touch-screen sensitiveness is rather low probably because fingers are much bigger than pens.


Personally I really hope that noone will "fix" the sensitiveness since after getting used to it it is very nice. :)
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
illogict
Engineer
Engineer
Posts: 12
Joined: 27 Jul 2005 14:24
Location: Évry (France)
Contact:

Re: Patch: Left click scrolling

Post by illogict »

Here is an updated version. It is now a drag and pull like: scroll direction will thus be the same whether you select "reverse scroll direction" option or not.
As it is not the same scroll as the others, I'm searching for another term, maybe some have ideas? :D
It also has its own option to be enabled.
It has been tested on my n810, the full port will follow.

Patch is against r12019.
Please apply the patch for the multiple mouse events treatment issue (http://www.tt-forums.net/viewtopic.php?f=33&t=36029) before this one, in order to avoid some issue with touch-screens for instance, and please comment :)
Attachments
openttd-left_scrolling-updated.patch
Updated patch
(12.44 KiB) Downloaded 137 times
Image
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2830
Joined: 16 May 2007 16:59

Re: Patch: Left click scrolling

Post by Zephyris »

Thank you for adding that feature, sorry if I sounded arsey earlier, it was a long day! It may be worth submitting both these patches letting people chose their personal preference.
illogict
Engineer
Engineer
Posts: 12
Joined: 27 Jul 2005 14:24
Location: Évry (France)
Contact:

Re: Patch: Left click scrolling

Post by illogict »

No problem at all :)
Anyway, my primary will is to make something fully usable with touchscreens, and I didn't have time to fully test the first patch with the n810 before posting it here.
Now that I think about it, the next step should be to have a fully unified patch, with the option to choose how we want it to act.
Last edited by illogict on 30 Jan 2008 19:57, edited 2 times in total.
Image
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: Patch: Left click scrolling

Post by FooBar »

Very nice second version! Works charmingly just with a regular mouse!

I'd love to see both options integraded, so that the user can choose between no left button scrolling and either of you two versions of the patch.
illogict
Engineer
Engineer
Posts: 12
Joined: 27 Jul 2005 14:24
Location: Évry (France)
Contact:

Re: Patch: Left click scrolling

Post by illogict »

Please find attached an updated version, that now has selectable way of working, either standard (works exactly like right-click scrolling), or Drag'n'Pull.
This has been made agains r12026 + latest version of my multiple mouse events treatment patch, that you should apply before this one.
Please comment.
Attachments
openttd-left_scrolling-updated_2.patch
New version
(12.71 KiB) Downloaded 134 times
Image
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: Patch: Left click scrolling

Post by FooBar »

illogict wrote:... that you should apply before this one...
I can't apply two patches with BuildOTTD :(

So I hope this thing gets in trunk real soon :D
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Patch: Left click scrolling

Post by DaleStan »

Just concatenate them into a single file.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Patch: Left click scrolling

Post by Bilbo »

FooBar wrote:
illogict wrote:... that you should apply before this one...
I can't apply two patches with BuildOTTD :(

So I hope this thing gets in trunk real soon :D
Well, you can :)

copy /b first.patch + second.patch merged.patch
then apply merged.patch ... of course the patches must not have any conflicts :)

Alternatively, you can use simply mingw + svn directly :)
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4552
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Patch: Left click scrolling

Post by Zuu »

illogict wrote:Please find attached an updated version, that now has selectable way of working, either standard (works exactly like right-click scrolling), or Drag'n'Pull.
This has been made agains r12026 + latest version of my multiple mouse events treatment patch, that you should apply before this one.
Please comment.
I built r12026 with
* twice_treated_mouse_events-updated.patch (currently last version)
* openttd-left_scrolling-updated_2.patch (currently last version)

(using Wacom) With "standard" mode I noticed that left-button-scroll setting set to standard the map movement it behaves the same as right-button movement, which is nice.

(using trackball) Works fine aswell i think. (don't use it much when I'm playing unless I'm on my laptop which lacks an ancient COM-port)


Naming
First I'm not native speaker of English so my understanding of the word "scrolling" might be slightly wrong. Also note that in the patch-screen there is already an option for "Function of scrollwheel".

Personally I'd rather not name translating the map "scrolling" as to me the word "scrolling" is bound to something that is done in one dimension. Such as scrolling with a scroll-wheel or the counterpart on laptops. I don't know about native English speakers but here "scroll" is commonly used as an abbreviation for scroll-wheel. Therefor I find it a bad choice to call this feature "left click scrolling".

Better ideas?
Perhaps "left click map movement"?
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 15 guests