Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
DorpsGek opened this issue Sep 30, 2007 · 7 comments
Closed

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

DorpsGek opened this issue Sep 30, 2007 · 7 comments
Labels
component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay

Comments

@DorpsGek
Copy link
Member

krase opened the ticket and wrote:

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.

Attachments

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/1265
@DorpsGek
Copy link
Member Author

Rubidium wrote:

It doesn't work on Windows or MacOS.


This comment was imported from FlySpray: https://bugs.openttd.org/task/1265#comment2804

@DorpsGek
Copy link
Member Author

DorpsGek commented Apr 1, 2008

t0mt0m wrote:

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


This comment was imported from FlySpray: https://bugs.openttd.org/task/1265#comment3823

@DorpsGek
Copy link
Member Author

Zuu wrote:

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.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/1265#comment3922

@DorpsGek
Copy link
Member Author

wollollo wrote:

This does not work in current (r15152) on my laptop running Arch Linux, nor does it work in 0.6.3


This comment was imported from FlySpray: https://bugs.openttd.org/task/1265#comment5376

@DorpsGek
Copy link
Member Author

frosch wrote:

Ok, let me guess:

  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.


This comment was imported from FlySpray: https://bugs.openttd.org/task/1265#comment5378

@DorpsGek
Copy link
Member Author

Zuu wrote:

The problem is that OpenTTD requires that the 'correct' combination of meta keys and normal keys should be typed to trigger an action. On some actions there exist fall-through checks for with and without shift. But in most cases there are no fall-through checks for other meta keys such as Alt Gr.

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.


This comment was imported from FlySpray: https://bugs.openttd.org/task/1265#comment5384

@DorpsGek
Copy link
Member Author

DorpsGek commented Nov 8, 2011

Yexo closed the ticket.

Reason for closing: Out of date

Can be done by modifying hotkeys.cfg now


This comment was imported from FlySpray: https://bugs.openttd.org/task/1265

@DorpsGek DorpsGek closed this as completed Nov 8, 2011
@DorpsGek DorpsGek added component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay labels Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay
Projects
None yet
Development

No branches or pull requests

1 participant