FS#1265 - Shortcut for zooming in with "+" not implemented
|
DetailsOn 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.
|
This task depends upon

wkc_plus.diff
(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.
1) trunk works for all keyboards where '+' is in fact shift+'='.
2) This patch works for all keyboards where '+' can be typed without shift.
3) Both fail for keyboards where '+' is types with shift+(some key, but not '=') (e.g. from wikipedia: hungarian, swiss and turkish keyboards).
Non-latin keyboards likely fail for both zooming in and out.
SDL have a feature that when enabled translates meta key + other key to a unicode value of the character typed. It is a bit tricky to use since when the user releases a key, SDL only sends the non-translated value. So when I press AltGr+A SDL gives the unicode value for semicolon (as well as the keycode for the a-key) but then when I releases my a-key the keycode for the a-key is sent. (I use a specialized version of the Svorak keyboard layout) The way OpenTTD works however makes it only see the keycode for a and that altgr was pressed, but not that according to my keyboard layout that becomes a semicolon.
I have dug a little in the keyboard stuff when I made my attempt on configurable hotkeys and from that I think that to 'fix' OpenTTD to work on keyboard layouts that are too far away from the American Qwerty layout will require a lot of effort. OpenTTD hotkeys need to be changed to symbol based instead of being trigged based on a combination of keycode and a meta key.
The keycodes that OpenTTD uses they give the correct A-Z character on dvorak, which has only A and M common with qwerty, but things like AltGr+j for equals sign it does not handle.