Patch: configurable hotkeys

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

St256
Engineer
Engineer
Posts: 32
Joined: 20 Jul 2007 11:03

Re: Patch: configurable hotkeys

Post by St256 »

CommanderZ wrote:Btw, is there any progress towards trunk with this patch?
Not really. There exists an Flyspray task, but it did not receive much attention.
Moriarty wrote:Back on topic - what does this patch do about hotkeys that are "redundent"? Specifically at present there are multiple keys for the "demolish" function. "d" on landscape, The number on other toolbars etc etc.
The hotkeys can be completely customized. If you want to have multiple keys for the demolish function, you can assign the demolish function to multiple keys, if you don't want to have any key, just don't assign the demolish function to any key. Per default, the key bindings of the original game are used (so yes, redundant keys for demolish).
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Patch: configurable hotkeys

Post by planetmaker »

St256 wrote:
CommanderZ wrote:Btw, is there any progress towards trunk with this patch?
Not really. There exists an Flyspray task, but it did not receive much attention.
Don't be disheartend by that. It doesn't mean that it isn't noticed or read. I like the idea of configurable key settings.

Good patches need time to mature and time being tested - which not necessarily reflects in replies though.
Moriarty
Tycoon
Tycoon
Posts: 1395
Joined: 12 Jun 2004 00:37
Location: United Kingdom of Great Britain and Northern Ireland
Contact:

Re: Patch: configurable hotkeys

Post by Moriarty »

DaleStan wrote:I've tried it. It is for me. (I can do PHP, Perl etc, I like my languages to be high-level).
You've made this strange assertion before. C++ *is* high level. Yeah, you can use mid-level C entities if you really want to, but you don't have to.[/quote]
In that case "higher" level language. As in, one where I don't have to bother with garbage collection on strict typing or boring things like that. :-)
Good patches need time to mature and time being tested
Typically what happens is they stagnate, are ignored and then lose compatibility with trunk. Or maybe I'm just cynical. Hehe.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Patch: configurable hotkeys

Post by DaleStan »

Moriarty wrote:
DaleStan wrote:
Moriarty wrote:I've tried it. It is for me. (I can do PHP, Perl etc, I like my languages to be high-level).
You've made this strange assertion before. C++ *is* high level. Yeah, you can use mid-level C entities if you really want to, but you don't have to.
In that case "higher" level language. As in, one where I don't have to bother with garbage collection on strict typing or boring things like that. :-)
vector, string, queue, map, /[io]?f?stream/, deque, queue, list, stack, ... They all do their own memory allocation and garbage collection.

In all of NFORenum, I'm pretty sure I don't ever manually allocate or free memory. I leave all that to the libraries.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
St256
Engineer
Engineer
Posts: 32
Joined: 20 Jul 2007 11:03

Re: Patch: configurable hotkeys

Post by St256 »

There is another update to the current trunk version. No functional changes. See first post for download.
St256
Engineer
Engineer
Posts: 32
Joined: 20 Jul 2007 11:03

Re: Patch: configurable hotkeys

Post by St256 »

As there were some conflicts when merging with trunk, there is another update. For download, see the first post of this topic.

Code: Select all

r13251:
  -Codechange: rename _patches to _settings as that is more logic.

r15410:
  -Cleanup: get rid of most of the references to the 'patches' except where it's 
    used for backward compatibility.
As the trunk no longer uses 'patch options', but uses the term 'advanced settings' now, to stay consistent, the hotkey command 'ShowPatchOptions' is now called 'ShowAdvancedSettings'.
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Patch: configurable hotkeys

Post by Bilbo »

I hope this patch hits trunk soon.

But I wonder one thing - what is so "special" about DrawBoundingBoxes that it is hardcoded to Ctrl+B? I can understand the quit/console/esc keys to be important enough to be hardcoded (it can be quite annoying if you redefine keys in a way that you can't exit the game) but why Ctrl+B? I've never used it and actually, I've not known about it until I examined your patch.
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
St256
Engineer
Engineer
Posts: 32
Joined: 20 Jul 2007 11:03

Re: Patch: configurable hotkeys

Post by St256 »

Bilbo wrote: But I wonder one thing - what is so "special" about DrawBoundingBoxes that it is hardcoded to Ctrl+B?
I was thinking that nobody uses it anyway, so why make it configurable. But after rethinking, now I am of the opinion, that it would be better reconfigurable in order not to loose the Ctrl+B shortcut.

So there is an update to the current trunk revision, which also allows to reconfigure DrawBoundingBox.

Edit: As usual - for download see first post of this topic.
User avatar
Ammler
President
President
Posts: 953
Joined: 18 Jun 2006 18:18
Location: Switzerland
Contact:

Re: Patch: configurable hotkeys

Post by Ammler »

I know some advanced players, which changed to DVORAK, and therefor they would really like to "reconfigure" some Hotkeys. ;-)

Greets
Ammler
St256
Engineer
Engineer
Posts: 32
Joined: 20 Jul 2007 11:03

Re: Patch: configurable hotkeys

Post by St256 »

There is an update of this patch to the current trunk again (first post).

This does not include [FS#2870] Q,W,E,D should work also without landscape toolbar being opened, because of incompatibilities in my hotkey concept with the requirement to access hotkeys of windows which are not open. But I will think about a solution and try to integrate that feature.
St256
Engineer
Engineer
Posts: 32
Joined: 20 Jul 2007 11:03

Re: Patch: configurable hotkeys

Post by St256 »

After some time, there is an update again. No functionality changes, just updated to current trunk. The aforementioned problem has not been solved yet. For a patch file see the first post of this topic.
Terkhen
OpenTTD Developer
OpenTTD Developer
Posts: 1034
Joined: 11 Sep 2008 07:32
Location: Spain

Re: Patch: configurable hotkeys

Post by Terkhen »

This patch can't be used with visual studio, as it does not add the new files to the visual studio project. Also, a question: has the patch been changed to take into account this new feature?.
St256
Engineer
Engineer
Posts: 32
Joined: 20 Jul 2007 11:03

Re: Patch: configurable hotkeys

Post by St256 »

Terkhen wrote:This patch can't be used with visual studio, as it does not add the new files to the visual studio project.
Sorry, I'm no visual studio user. But it should not be that hard. Just add the new files "hotkey.cpp", "hotkey_type.h" and "hotkey_func.h" to the project.
Terkhen wrote:has the patch been changed to take into account this new feature?
No, it is completely against my original concept (defining hotkeys for each window seperately) to be able to call functions of a different window (here: landcaping toolbox) out of another one (here: main window). Unfortunately a change of this concept would require a significant amount of work and I did not have time to rewrite the patch.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Patch: configurable hotkeys

Post by DaleStan »

Visual Studio project files are XML files; it shouldn't be hard to edit them manually.

Also, I think there's a script that automatically updates and/or regenerates them from source.list, but I'm not certain about that.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: Patch: configurable hotkeys

Post by Rubidium »

DaleStan wrote:Also, I think there's a script that automatically updates and/or regenerates them from source.list, but I'm not certain about that.
Yes that script exists, or actually there are two; a bash+awk script (for Unices) and one in vbs (for Windows).
Terkhen
OpenTTD Developer
OpenTTD Developer
Posts: 1034
Joined: 11 Sep 2008 07:32
Location: Spain

Re: Patch: configurable hotkeys

Post by Terkhen »

Rubidium wrote:
DaleStan wrote:Also, I think there's a script that automatically updates and/or regenerates them from source.list, but I'm not certain about that.
Yes that script exists, or actually there are two; a bash+awk script (for Unices) and one in vbs (for Windows).
That script is really handy, thanks! :D

The attached diff file already includes the needed changes for compiling with Visual Studio, and I have uploaded a compiled binary for win32 too.
Attachments
keyb_config_r17333_v1.8.diff
(88.74 KiB) Downloaded 158 times
keyb_config_win32_r17333_v1.8.rar
(2.72 MiB) Downloaded 126 times
St256
Engineer
Engineer
Posts: 32
Joined: 20 Jul 2007 11:03

Re: Patch: configurable hotkeys

Post by St256 »

After a long time of inactivity, there is again an update of the patch to apply against the current trunk revision. No functional changes are included. The patch, however, contains the visual studio project files this time. For downloading it - as usual - see the first post of this topic.
Stomper1987
Engineer
Engineer
Posts: 2
Joined: 12 Mar 2017 16:57

Re: Patch: configurable hotkeys

Post by Stomper1987 »

Hello,

I'm getting back into TTD and I love the customization provided by TTD Open. Here's my question:

I use the 1-4 keys to build different railroads, which is on the top left side of the keyboard, but I use the arrow buttons to move my view, which is on the bottom right side of the keyboard. Is it possible to bind the scroll keys to W / A / S / D like a first person shooter? This would put the buttons that I continually use next to each other.

Thanks for your help!

Josh
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Patch: configurable hotkeys

Post by Alberth »

Did you try editing the hotkeys.cfg file?
Being a retired OpenTTD developer does not mean I know what I am doing.
Stomper1987
Engineer
Engineer
Posts: 2
Joined: 12 Mar 2017 16:57

Re: Patch: configurable hotkeys

Post by Stomper1987 »

Thank you for responding so quickly! I've gone through the hotkeys.cfg file but I can't find anything that references a hotkey that moves the map.

Am I missing something?
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Google [Bot] and 13 guests