Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Sun Apr 20, 2014 1:18 pm

All times are UTC




Post new topic Reply to topic  [ 33 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Sun Jan 27, 2008 7:17 pm 
Offline
Engineer
Engineer
User avatar

Joined: Wed Jul 27, 2005 2:24 pm
Posts: 12
Location: Évry (France)
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:
File comment: Patch to enable left-click scrolling
openttd-left_scrolling.patch [9.35 KiB]
Downloaded 117 times

_________________
Image
Top
 Profile  
 
PostPosted: Sun Jan 27, 2008 7:48 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Wed Jun 06, 2007 9:07 pm
Posts: 1710
Location: Czech Republic
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)


Top
 Profile  
 
PostPosted: Mon Jan 28, 2008 12:28 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Wed May 16, 2007 4:59 pm
Posts: 2701
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...

_________________
GRVTS/eGRVTS --- Generic Tram Set --- UK Town Set --- zBase ---RichardWheeler.net


Top
 Profile  
 
PostPosted: Mon Jan 28, 2008 12:46 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Fri Jan 19, 2007 7:26 pm
Posts: 305
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 84 times
Top
 Profile  
 
PostPosted: Mon Jan 28, 2008 1:14 pm 
Offline
Engineer
Engineer

Joined: Mon Sep 12, 2005 3:35 pm
Posts: 26
Location: Nederland
Maybe this would be a nice patch for the DS port that is beïng developped.


Top
 Profile  
 
PostPosted: Tue Jan 29, 2008 8:34 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4335
Location: /home/sweden
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)


Top
 Profile  
 
PostPosted: Tue Jan 29, 2008 1:41 pm 
Offline
Engineer
Engineer
User avatar

Joined: Wed Jul 27, 2005 2:24 pm
Posts: 12
Location: Évry (France)
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


Top
 Profile  
 
PostPosted: Tue Jan 29, 2008 3:27 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon May 21, 2007 11:47 am
Posts: 6259
Location: The Netherlands
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.

_________________
FooBar's Tram Tracks | TransRapid Track Set | Metro Track Set | OpenGFX base graphics set | FIRS Industry Replacement Set
Dutch Tram Set | Dutch Trainset 2 | Dutch Road Furniture


Top
 Profile  
 
PostPosted: Tue Jan 29, 2008 9:31 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Mon Mar 08, 2004 1:10 pm
Posts: 2088
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 :?


Top
 Profile  
 
PostPosted: Tue Jan 29, 2008 10:40 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Wed May 16, 2007 4:59 pm
Posts: 2701
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!

_________________
GRVTS/eGRVTS --- Generic Tram Set --- UK Town Set --- zBase ---RichardWheeler.net


Top
 Profile  
 
PostPosted: Wed Jan 30, 2008 6:00 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4335
Location: /home/sweden
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)


Top
 Profile  
 
PostPosted: Wed Jan 30, 2008 6:15 pm 
Offline
Engineer
Engineer
User avatar

Joined: Wed Jul 27, 2005 2:24 pm
Posts: 12
Location: Évry (France)
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:
File comment: Updated patch
openttd-left_scrolling-updated.patch [12.44 KiB]
Downloaded 78 times

_________________
Image
Top
 Profile  
 
PostPosted: Wed Jan 30, 2008 6:44 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Wed May 16, 2007 4:59 pm
Posts: 2701
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.

_________________
GRVTS/eGRVTS --- Generic Tram Set --- UK Town Set --- zBase ---RichardWheeler.net


Top
 Profile  
 
PostPosted: Wed Jan 30, 2008 7:16 pm 
Offline
Engineer
Engineer
User avatar

Joined: Wed Jul 27, 2005 2:24 pm
Posts: 12
Location: Évry (France)
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.

_________________
Image


Last edited by illogict on Wed Jan 30, 2008 7:57 pm, edited 2 times in total.

Top
 Profile  
 
PostPosted: Wed Jan 30, 2008 7:52 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon May 21, 2007 11:47 am
Posts: 6259
Location: The Netherlands
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.

_________________
FooBar's Tram Tracks | TransRapid Track Set | Metro Track Set | OpenGFX base graphics set | FIRS Industry Replacement Set
Dutch Tram Set | Dutch Trainset 2 | Dutch Road Furniture


Top
 Profile  
 
PostPosted: Thu Jan 31, 2008 10:31 am 
Offline
Engineer
Engineer
User avatar

Joined: Wed Jul 27, 2005 2:24 pm
Posts: 12
Location: Évry (France)
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:
File comment: New version
openttd-left_scrolling-updated_2.patch [12.71 KiB]
Downloaded 76 times

_________________
Image
Top
 Profile  
 
PostPosted: Thu Jan 31, 2008 7:48 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon May 21, 2007 11:47 am
Posts: 6259
Location: The Netherlands
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

_________________
FooBar's Tram Tracks | TransRapid Track Set | Metro Track Set | OpenGFX base graphics set | FIRS Industry Replacement Set
Dutch Tram Set | Dutch Trainset 2 | Dutch Road Furniture


Top
 Profile  
 
PostPosted: Thu Jan 31, 2008 8:29 pm 
Offline
TTDPatch Developer
TTDPatch Developer

Joined: Wed Feb 18, 2004 3:06 am
Posts: 10285
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


Top
 Profile  
 
PostPosted: Thu Jan 31, 2008 8:32 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Wed Jun 06, 2007 9:07 pm
Posts: 1710
Location: Czech Republic
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)


Top
 Profile  
 
PostPosted: Sat Feb 02, 2008 10:40 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4335
Location: /home/sweden
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)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 33 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB © 2000-2013 phpBB Group

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2013.
Hosted by Zernebok Hosting.