FS#6375 - Allow SPACE as a hotkey

Attached to Project: OpenTTD
Opened by Ram_Z (Ram_Z) - Wednesday, 30 September 2015, 22:39 GMT
Last edited by andythenorth (andythenorth) - Saturday, 02 September 2017, 12:55 GMT
Type Feature Request
Category Interface
Status With patch
Assigned To No-one
Operating System All
Severity Low
Priority Normal
Reported Version trunk
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


I would like to remap the spacebar to something useful but this is currently not possible.

Attached is a rough patch that allows this.

Testing is minimal, so far I only tried remapping the [news]:quit hotkey to SPACE (RETURN) and map [maintoolbar]:pause to SPACE. This works, I can close the news windown with RETURN and pause the game with SPACE. However the game currently crashes when saving the `hotkeys.cfg` back to disk with "Assertion failed [..]/src/hotkeys.cpp: keycode < 128".
This task depends upon

Comment by Ram_Z (Ram_Z) - Sunday, 04 October 2015, 16:48 GMT
Here is an updated patch.
Comment by andythenorth (andythenorth) - Saturday, 02 September 2017, 13:09 GMT
Applied to r27910

Patch reliably causes OpenTTD to crash when quitting the game.

*** OpenTTD Crash Report ***

Crash at: Sat Sep 2 13:06:20 2017
In game date: 1965-01-01 (0)

Crash reason:
Signal: Segmentation fault: 11 (11)
Message: <none>

OpenTTD version:
Version: gf1e54b43M (2)
NewGRF ver: 18006d06
Bits: 64
Endian: little
Dedicated: no
Build date: Sep 2 2017 13:20:49

[00] openttd 0x00000001096b6a0a (CrashLog::FillCrashLog(char*, char const*) const + 330)
[01] ??? 0x0000000000000010
[02] openttd 0x00000001097408c4 (IniGroup::GetItem(char const*, bool) + 52)

Operating system:
Name: Mac OS X
Release: 10.12.6
Machine: Intel x86-64h Haswell
Min Ver: 101200
Compiler: GCC 4.2.1 "4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)"

Blitter: 32bpp-optimized
Graphics set: original_windows (0)
Language: lang/english.lng
Music driver: cocoa
Music set: original_windows (1)
Network: no
Sound driver: cocoa
Sound set: original_windows (0)
Video driver: cocoa

Small: sprite
Medium: sprite
Large: sprite
Mono: sprite

AI Configuration (local: 0):
0: Human
GS: Busy Bee (v305817)

FreeType: 2.7.1
LZMA: 5.2.3
LZO: 2.09
PNG: 1.6.29
Zlib: 1.2.8

---- gamelog start ----
Tick 0: new game started
Revision text changed to gf1e54b43M, savegame version 196, modified, _openttd_newgrf_version = 0x18006d06
New game mode: 1 landscape: 0
Added NewGRF: GRF ID 9787EAFE, checksum 941B996E717928A96F4999DE103578C0, filename: road-hog/road-hog.grf (md5sum matches)
Added NewGRF: GRF ID 44440A80, checksum A930B079A5B8985E94EA823604CC276B, filename: av9.8-0.83/av9point8.grf (md5sum matches)
Added NewGRF: GRF ID 55535333, checksum E9FCF099F78F17BD215445CD75D1B714, filename: unsinkable-sam/unsinkable-sam.grf (md5sum matches)
Added NewGRF: GRF ID 43415000, checksum 4DA9FE9A87DD330EBAD43916771BAF21, filename: opengfx_airports-0.4.2/ogfx-airports.grf (md5sum matches)
Added NewGRF: GRF ID 43485053, checksum 107210078AB4C22C7D83BA65ED9AF16F, filename: chips_station_set-1.8.0/chips.grf (md5sum matches)
Added NewGRF: GRF ID 4341121F, checksum 9FA559320CDA7CCD69211EC90A7EE8CB, filename: iron-horse.grf (md5sum matches)
Added NewGRF: GRF ID FBFB0B01, checksum 44421AC640D62C684882B39354F92F6C, filename: termite/termite.grf (md5sum matches)
Added NewGRF: GRF ID F1250007, checksum DC31D7D9A9196B2F2F3277EEE192D1D2, filename: firs.grf (md5sum matches)
---- gamelog end ----

*** End of OpenTTD Crash Report ***