News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

New Keybindings

Started by Aquin, September 09, 2013, 12:52:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Aquin

Unused letters so far are:
i, j, o, q, x, y, D, E, I, N, X, Y, Z

I would love to have a direct key to
- x - build Tram-tracks
- X - and catenaries
- i - info about Keybinding, other unbound keys should not trigger this
- y - Street tunnel
- Y - Street bridge
- q - Rail tunnel
- D - Rail bridge
- N - Narrowgauge track (could be switched with game info "n")
- j - Canals

Fabio

The idea of binding those tools is a pretty good one, further thoughts should go on all key bindings, though.
Anyway, this is not an extension request, as key mapping is entirely pakset-dependent and customizable.

prissi

Catenaries shoudl be bind to e, unless you are talking about a different pak. X is quit. You can easily add own bindings for certain paks, when you specify the name of the pak to be built.

Aquin

Thanks for the info that keybinding is pak-dependent. As it is stored in plain text in the menuconf.tab it is easily configurable without compiling anything.

What is not pak-specific is the help-page that displays if an unbound key is pressed, if there are major changes in the keybinding this can get confusing.

Bind a key for tram-tracks was easy. Tunnels and Bridges still elude me, there must be something different than for simple ways or wayobjects.

I was playing pak128, which has different catenaries for trams and bussed. There 'e' does bind to catenaries, it will choose whatever catenary was selected last, be it a train or a tram or a road catenary.

I might think about a complete improved list and post it in the pak128-section.

prissi

The helpfile is automatically generated from the keybindings and the tooltip strings of tools. So this will always reflect the current keybindings, no matter what you added to the menuconf.tab.

And as said before, you can bind to the way building tool (or the wayobj tool) and given a name; in this case it will use only this object.

Aquin

I played around a lot with the menuconf.tab it but keybindings for bridges and tunnels crash the game.

What works fine is:

toolbar[2][6]=general_tool[17],16,j,2   # remove track <- add a keybind here
...
toolbar[2][11]=general_tool[14],,t,2     # build track
toolbar[2][12]=general_tool[18],,e,2    # build catenary
...
toolbar[7][11]=general_tool[14],,t,7     # build tram-track <- add a line there


What crashes the game are added lines like:

toolbar[2][13]=general_tool[15],,x,2   # build bridge
toolbar[2][14]=general_tool[16],,y,2   # build tunnel

The game will crash if I press x or y and then click anywhere, or if I try to display the list of keybindings.

prissi

I am surprised that the ways are working for electrification. The only official statement is that pak-names are required. So you have to use railtunnel instead of a number.

Aquin

Actually the electrification tool doesn't care about the number, it works even without specifing a number.

Quote from: prissi on September 10, 2013, 08:50:21 PM
The only official statement is that pak-names are required. So you have to use railtunnel instead of a number.

I don't understand this, can you please give an example?

prissi

toolbar[x][y]=general_tool[16],,X,FastRailTunnel
should bind the FastRailTunnel of pak64 to the key X

Aquin

Thanks alot.
It works fine for tunnels, bridges and stations. Although it can make them available before their availability date in timeline-games.
Would it be difficult to modify the code of the bridge tool (and tunnel / station tool), such that it remembers the last bridgetype? The tool for ways can do this already, so maybe copying the corresponding function might already do the trick?