The International Simutrans Forum

 

Author Topic: Keyboard binding  (Read 481 times)

0 Members and 1 Guest are viewing this topic.

Offline Ranran

  • Devotee
  • *
  • Posts: 1507
  • Languages: ja
Keyboard binding
« on: October 16, 2020, 12:55:07 AM »
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).

Offline Freahk

  • Devotee
  • *
  • Posts: 1501
  • Languages: DE, EN
Re: Keyboard binding
« Reply #1 on: October 16, 2020, 02:26:00 AM »
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.

Offline Ranran

  • Devotee
  • *
  • Posts: 1507
  • Languages: ja
Re: Keyboard binding
« Reply #2 on: October 16, 2020, 02:40:13 AM »
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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10635
  • Languages: De,EN,JP
Re: Keyboard binding
« Reply #3 on: October 16, 2020, 02:56:27 AM »
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.

Offline Ranran

  • Devotee
  • *
  • Posts: 1507
  • Languages: ja
Re: Keyboard binding
« Reply #4 on: October 16, 2020, 11:10:43 AM »
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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10635
  • Languages: De,EN,JP
Re: Keyboard binding
« Reply #5 on: October 16, 2020, 01:57:02 PM »
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

Offline Ranran

  • Devotee
  • *
  • Posts: 1507
  • Languages: ja
Re: Keyboard binding
« Reply #6 on: October 17, 2020, 01:41:44 AM »
Thank you for the implementation.
I'm testing this, but W and S work fine if I set it like this
Code: [Select]
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? (´・ω・`)

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10635
  • Languages: De,EN,JP
Re: Keyboard binding
« Reply #7 on: October 17, 2020, 12:26:06 PM »
a is usually assinged to query too and d is lowering land. These are defined further up and thus take preference ...

Offline Ranran

  • Devotee
  • *
  • Posts: 1507
  • Languages: ja
Re: Keyboard binding
« Reply #8 on: October 17, 2020, 01:03:40 PM »
I'm sorry. I was only testing r9294. :-[
It worked correctly on r9298.  :hat: