Remap Keys?

OpenTTD is a fully open-sourced reimplementation of TTD, written in C++, boasting improved gameplay and many new features.

Moderator: OpenTTD Developers

Post Reply
User avatar
Redirect Left
Tycoon
Tycoon
Posts: 7249
Joined: 22 Jan 2005 19:31
Location: Wakefield, West Yorkshire

Remap Keys?

Post by Redirect Left »

Is it possible to remap keys in this game? I find it super super irritating getting out of <any game> and then trying to use WASD to move about, and instead OpenTTD spits out lots of boxes for things. So just wondering if its possible to remap these hotkeys, as I always use the bar at the top and my mouse to choose what I want, insteaad of using the keys.

So yeah, is this a possibility?
Image
Need some good tested AI? - Unofficial AI Tester, list of good stuff & thread is here.
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5602
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: Remap Keys?

Post by PikkaBird »

Did you even look? ;) hotkeys.cfg in the same place as your openttd.cfg.
Eddi
Tycoon
Tycoon
Posts: 8267
Joined: 17 Jan 2007 00:14

Re: Remap Keys?

Post by Eddi »

there is no GUI for that (yet), but in hotkeys.cfg you can change almost everything.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Remap Keys?

Post by Zuu »

Though, IIRC using arrow keys for viewport movement is not configurable in hotkeys.cfg. To change that you probably need to make source code changes and (re-)compile OpenTTD.

If I understand the original question, Redirect Left wants to change viewport movement from arrow keys to WASD-keys.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
Redirect Left
Tycoon
Tycoon
Posts: 7249
Joined: 22 Jan 2005 19:31
Location: Wakefield, West Yorkshire

Re: Remap Keys?

Post by Redirect Left »

Zuu wrote: If I understand the original question, Redirect Left wants to change viewport movement from arrow keys to WASD-keys.
Just movement in general to arrow OR WASD, like many games these days, but if I can only have one or the other, i'll not bother even opening the cfg file, i'll just get disappointed :p
PikkaBird wrote:Did you even look? ;) hotkeys.cfg in the same place as your openttd.cfg.
Not there no, I assumed we wouldn't be using .cfg files to edit basic settings these days ;)

edit: just removed the things that WASD was keyed towards, rest of that file is just tl;dr
Image
Need some good tested AI? - Unofficial AI Tester, list of good stuff & thread is here.
arnaud380
Engineer
Engineer
Posts: 1
Joined: 02 Apr 2020 19:03

Re: Remap Keys?

Post by arnaud380 »

Hello everybody,

I reopen the discussion because I would like to find a solution to the change of the arrow keys. I play on a laptop and because of my muscle problems on the wrist it is very painful to use the arrow keys.

Thank you
_dp_
Transport Coordinator
Transport Coordinator
Posts: 278
Joined: 18 Dec 2013 12:32

Re: Remap Keys?

Post by _dp_ »

Have you tried moving the map with the mouse? Probably the main reason why no one bothered to allow remapping arrow keys is that they suck anyway.
dcraig327
Engineer
Engineer
Posts: 1
Joined: 20 Mar 2023 00:59

Re: Remap Keys?

Post by dcraig327 »

You can use WASD fairly easily without recompiling the game.
  1. Download AutoHotkey v1.1
  2. Save all of the below code into a file called openttd.ahk and double click the file
  3. If you see a new green letter H taskbar icon, then it's working
  4. (optional)To have it auto-run on startup. Press Win+R, type "shell:startup", create a new shortcut to openttd.ahk in that folder that opened up

Code: Select all

; Optional. Reassign the following two keybinds in hotkeys.cfg as they will no longer be accessable.

; [order]
; skip = D
; [railtoolbar]
; signal = S

; This is a AutoHotkey v1.1 script
#If WinActive("ahk_exe openttd.exe")
w::Up
s::Down
a::Left
d::Right
return

FYI, there's a similar program for Linux called AutoKey.
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: Semrush [Bot] and 30 guests