OpenTTD

Login!
Register as a new userLost password?

for Project:

FS#1265 — Shortcut for zooming in with "+" not implemented

Attached to Project— OpenTTD
Opened by Sebaastian Kratzert (krase) - Sunday, 30 September 2007, 11:26AM
Patch
User Interface
New
No-one
All
High
Normal
Devel (specify rev)
Undecided
Undecided
0%
On laptops where there is no numpad it's very inconvenient to zoom in by pressing Shift+F5. The "-" however is implemented so i assume that it has simply been forgotten to implement zooming in with the normal "+" key.  wkc_plus.diff
This task depends upon

This task blocks these from closing
Comment by Remko Bijker (Rubidium) - Sunday, 25 November 2007, 12:26AM

It doesn't work on Windows or MacOS.


Comment by Tom Bass (t0mt0m) - Tuesday, 01 April 2008, 09:46AM

With the current svn version the '+' and '-' keys are working properly (zoom in/out) on windows (selfcompiled openttd)


Comment by Leif Linse (Zuu) - Wednesday, 16 April 2008, 09:10PM

Nightly build (r12717), windows XP: '-' works but not '+' for zooming. Which is a bit annoying to have to click on the zoom-in button in the toolbar.

(when talking about +, = and other keys the non-numpad versions are meant)

So I've taken the patch and by hand implemented it in current svn version of OpenTTD. (the drivers have been reorganized a bit since r11101) I've managed to get the keycode for Windows by simply run synergy[1] in debug level 1 and read the value from the debug window. The keycode for Mac was found after help from Mwa (on IRC). Notable, on mac = and + share the same keycode. While that is ok in this patch, someone in future might be mislead to though that WKC_PLUS and WKC_EQUALS express different keys on all platforms. So an alternative approach could be make the SDL and Win32 driver send WKC_EQUALS when '+' is detected to make it work equal on all platforms.

[1] Synergy is an open source tool to share keyboard(s) and pointing devices attached to one computer between several computers.

  plus_key.patch