News:

Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

Keyboard binding

Started by Ranran, October 16, 2020, 12:55:07 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ranran

I play a lot of simulation games on steam etc. and I think the keyboard settings of Simutrans are very strange compared to those games...
When I get back to simutrans from those games, I just try to scroll the map using the WASD key in the habit of those games. As a result, some windows open unintentionally.

And each time I wonder why the 12346789 key (not 10 keys) are bound to a scroll and cannot be changed. Since those keys are lined up side by side, it's not intuitive to use them to scroll the map. (´・ω・`)
I've always wanted to change wasd to scroll and instead assign a menu to 1-0 keys (not 10 keys).

Mariculous

https://en.wikipedia.org/wiki/Numeric_keypad#/media/File:Numpad.svg
That is why. Opposing to the "normal" arrow keys or wasd, the numpad is arranged in a layout that does (imho intuitively) cover diagonal directions as well.

Ranran

What are you talking about? I said it wasn't 10 keys, but the expression "10 keys" might not have been correct. I'm talking about keys from 1 to 0 that aren't a numeric keypad.
Normally, num1 to num0 and 1 to 0 should be able to be set separately.

prissi

This limitation was inhereted from SDL, which did no care about the status of the number block. But I think that can be changed nowadays with SDL2.

Ranran

Thank you for your reply. At the same time, it would be helpful if the scroll key could be made configurable.
It is currently not possible to assign it to another key.

prissi

Ok r9294 gets a new tool, simple_tool[36] The default parameter for this tool is dx|dy, so you can implement 'wasd' map movement. Also now Simutrans only moves the map when not numlock on, unless you specify it in menuconf.tab for the number keys

Ranran

Thank you for the implementation.
I'm testing this, but W and S work fine if I set it like this
toolbar[0][43]=simple_tool[36]=,,w,-1|-1
toolbar[0][44]=simple_tool[36]=,,a,-1|1
toolbar[0][45]=simple_tool[36]=,,s,1|1
toolbar[0][46]=simple_tool[36]=,,d,1|-1

However, A and D don't work. (Doesn't even open help)
Are the A and D settings wrong? (´・ω・`)

prissi

a is usually assinged to query too and d is lowering land. These are defined further up and thus take preference ...

Ranran

I'm sorry. I was only testing r9294. :-[
It worked correctly on r9298.  :hat: