Diagonal scrolling with arrow keys

Got an idea for OpenTTD? Post it here!

Moderator: OpenTTD Developers

Post Reply
User avatar
jacke
Director
Director
Posts: 533
Joined: 19 May 2002 14:47
Location: Sweden

Diagonal scrolling with arrow keys

Post by jacke »

As I always have used the arrow keys for scrolling, I really miss the way this works in TTD. I want to be able to scroll diagonal by pressing two arrow keys.
And scrolling faster with shift-key does behave strange, you have to press the shift key first and then the arrow key to make it scroll faster, which is very annoying.

I saw a feature request for this at source forge, but there were no comments given.

Just wonder if there are any plans to "fix" this ?
mike[F]
Traffic Manager
Traffic Manager
Posts: 232
Joined: 26 Mar 2004 18:56

Post by mike[F] »

I would like to see this improvement too.
-mike[F]
Caught in the rush of the crowd, lost in a wall of sound...
User avatar
Rob
Tycoon
Tycoon
Posts: 4355
Joined: 31 Dec 2002 16:52
Location: Ven-Zelderheide, The Netherlands

Post by Rob »

In TTD I always "scroll" with the help of the "C-key" (center on the mousecursor).
This way you can scroll in any direction and nearly at any speed. Just move the cursor into the direction dat you want to scroll, and press C, once or mutiple times. The screen gets redrawn with the new center at the position of the mousecursor.
If you move the mousecursor at the edge of the screen you'll scroll fast and if you place it in the corner of the screen you'l scroll diagonally. :D
Wie zich gelukkig voelt met het geluk van anderen, bezit een rijkdom zonder grenzen. (F.Daels)
Image
Still the best OS around
User avatar
jacke
Director
Director
Posts: 533
Joined: 19 May 2002 14:47
Location: Sweden

Post by jacke »

Rob wrote:In TTD I always "scroll" with the help of the "C-key" (center on the mousecursor).
This way you can scroll in any direction and nearly at any speed. Just move the cursor into the direction dat you want to scroll, and press C, once or mutiple times. The screen gets redrawn with the new center at the position of the mousecursor.
If you move the mousecursor at the edge of the screen you'll scroll fast and if you place it in the corner of the screen you'l scroll diagonally. :D
Oh, didn't know you could do this, have to try :)
testman
Engineer
Engineer
Posts: 8
Joined: 30 Oct 2003 10:44

Scrolling

Post by testman »

Hello,

Yesterday, late in the night, I added a little quick patch on sourgeforge.net that allows to use the middle button of your mouse instead of the C key for the same result...

Could you try it ? (I joined the patch to this post)

(The code isn't finished in the sense it is only for windows for the moment, and there's no way to turn it off, but if you guys like it, I could finish the implementation...)

Testman57 (once was marked as a developer for OpenTTD :( )
Attachments
middle_scroll.patch
The first draft patch itself
(1.97 KiB) Downloaded 247 times
User avatar
jacke
Director
Director
Posts: 533
Joined: 19 May 2002 14:47
Location: Sweden

Post by jacke »

I'll try it if you make it work in linux :wink:
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Re: Scrolling

Post by Bjarni »

testman wrote:Testman57 (once was marked as a developer for OpenTTD :( )
you could be that again if you are more active. We removed the people, who didn't submit anything for a long while and the current developers didn't even know
testman
Engineer
Engineer
Posts: 8
Joined: 30 Oct 2003 10:44

Post by testman »

The problem for the linux version is that I don't seem able to compile using SDL correctly (Openttd tries to lauch but exits directly without any error...)
I think I could do the code blindly, but then it would be very random as a result (I think the code to be changed is in the the "case SDL_MOUSEBUTTONDOWN and SDL_MOUSEBUTTONUP" section, it only needs to set _middle_button_down = true and _middle_button_clicked = true in the event of a SDL_BUTTON_MIDDLE, it is quite straightforward... but I have temporarly no access to my dev pc :(...

I Hope I can do it this evening...

-- edit --
Here is an update to the patch, it *should* now work with sdl (and linux...), but I can't give any warranty, as I am not able to test it under linux, not even with sdl under windows...

Happy testing, and any comment would be welcome
(I already have some improvements on mind)

Testman57
Attachments
middle_scroll2.patch
(2.73 KiB) Downloaded 254 times
Last edited by testman on 30 May 2004 18:02, edited 1 time in total.
User avatar
dominik81
OpenTTD Developer
OpenTTD Developer
Posts: 768
Joined: 16 Aug 2003 12:55
Location: Bonn, Germany

Post by dominik81 »

Diagonal arrow scrolling is in SVN by the way (at least for SDL, I don't know about Win32).
"There's a readme that comes with the source. I suggest you read it."
- Korenn
User avatar
jacke
Director
Director
Posts: 533
Joined: 19 May 2002 14:47
Location: Sweden

Post by jacke »

dominik81 wrote:Diagonal arrow scrolling is in SVN by the way (at least for SDL, I don't know about Win32).
Great :)
I just tried and it worked fine, but there is one little thing with scrolling that still annoys me...
When you press an arrow-key + shift-key to scroll faster, and then release the shift-key without releasing the arrow-key, the scrolling stops. You have to release the arrow-key and press it again to continue scrolling, which I think shouldn't be needed.
Did you get me ? :)
Post Reply

Return to “OpenTTD Suggestions”

Who is online

Users browsing this forum: No registered users and 1 guest