Completely customizable hotkeys mod
-
Feeling limited in creating your ultimate hotkey layout? Look no further.
TBA/work in progress mod that will allow you to customize your hotkeys programatically. You will need to write code to change it, but it has a fairly easy to understand structure to it. Example:
E =
- If you have only factories selected = execute the custom HotbuildOverhaul (a mod) group "HBO_T1_2". I have it saved as the second T1 unit which means it builds land scout / air scout for example.
- If you have only engineers selected = start reclaim mode
- Else (if you have nothing selected) = select all bombers on screen that are not torpedo ("ANTINAVY")
- Then, assign a subhotkey for E, meaning that if you quickly click E again you'll select all bombers on the whole map instead.
The time you have to register a subhotkey is taken from the double-click decay time that you can set in the original settings. I think the default is 500ms. Then it is reset. If you use another key that is not in the subhotkeys (or if you don't have any subhotkeys registered) it will ofc register whatever you pressed even within those 500ms. You can technically nest an infinate amount of more subhotkeys inside subhotkeys as well to really go wild with your combos.
More examples:
Q =
- If any unit/units are selected = enter patrol mode.
- If nothing selected = Select all onscreen idle/moving/patrolling/attackmoving T1 engineers (engineers that have no build order as part of their queue basically)
- Q --> 2 = select same but T2 engineers. (Q --> 3 = T3 eng, Q --> 4 = SACUs)
- Q --> Q select all those T1 engineers and enter patrol mode.
I have the Y button set for all my commander enhancements:
- Y = switch to the enhancements tab
- Y --> T = Start Tech upgrade
- Y --> U = Start Gun upgrade
- etc with all buttons surrounding Y
And so on, only your imagination sets the limits.
The obvious advantage here is that you can use the same key for different things depending on the context. Kind of like build mode but automatic.
I have migrated almost all my hotkeys in there and use it on a daily basis, but you can mix with your ordinary hotkeys if you only want to customize a few.
Right now it overwrites every hotkey that you put in there, so you put the E hotkey in there it replaces (and deletes forever) your old E hotkey. Hence I am not publishing an alpha release for everyone yet because I don't want to ruin someones hotkeys. I forked it from the MoreHotkeyLayouts mod that has a neat function that saves your old hotkeys the first time you run the mod, but I still need to make sure that is working and stable.
Future idea
- Multiple profiles. Right now it's all just in one big file, but it would be cool if anyone who takes the time to make their own profile can upload it and we can add those as a different profile. If you like a profile but some key is different on your keyboard, fix it, upload and every profile can then have different language versions too. These profiles could then be selected from a graphical interface as well as resetting your old keys if you want to.
Anyone else obsessed with hotkeys? Feel free to share your thoughts.
As long as you understand that you need to take a backup of your Game.prefs file I'll gladly give you access.
Always open to collaborate if you want to hep out
More mods to come.
// FreadyFish
-
... will allow you to customize your hotkeys programatically. You will need to write code to change it, but it has a fairly easy to understand structure to it...
Any program for user is hard. Don't rely on user's understanding how code works. There is only one case that user may do something - a config file. Create some kind of parser that parses config user can edit.
-
You might wanna take a look at the hotbuild code since that's doing the same, but is limited to build commands currently. (maybe you already did)
It also features hotkey creation from a simplified config file and allows allows adding keys later on (via mods for example).
You may wann check out the cycling preview it shows for your multi-stage hotkeys.
Maybe you also want to implement this or parts of this into the base FAF hotbuild, since in the long run it makes sense to have hotbuild be expanded to handle more different kinds of commands instead of only build commands. -
@azath0th Yeah I hear you, it's a good idea. I'll see what I can do. PS: big fan, I stole a lot of your code
-
@nex Haven't looked at that code in detail but I have thought about those previews. I'll check it out when I get there. Implementing it into core is more than I ever imagined but I can see it working. So much to do though, would prefer some help with that to get it right. I'll think about opening up a suggestion on github when I'm done with the proof of concept version and see who's interested. Thanks!
-
@freadyfish stealing code isn't good idea at all. Put the license on top of each file you copied or use directly from mods.
-
@azath0th Ehm you don't have a license file and you leave the copyright field empty? Or am I wrong in assuming you are 4z0t? Otherwise, yes, ofc. Even though I do not understand at all why anyone would copyright a mod. Very lame
-
@freadyfish said in Completely customizable hotkeys mod:
Ehm you don't have a license file and you leave the copyright field empty?
That'd mean you aren't allowed to copy anything from the mod and publish it, without getting approval from the author first, as is explained on the github licensing page for example.
https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository#choosing-the-right-licenseSure it'd be nicer if everyone put a nice license for fair use with credit to the original author, but if the mod author is active you should ask if you can copy stuff or at least credit them for what you copied in your work. (aside from copy pasting singular lines or something)
-
@nex Aaah. Yes. You are right actually. I assumed too much. In @Azath0th case he does have the MIT license on his github repo so I will include that license for any of my releases and all should be fine. For everyone else, just sue me (that's a joke!)
-
You don't have to put any license if you just import required functions from a mod. About license for each mod: I will add these, but there are too many mods for update, it should come one by one. Thanks for pointing.
-
@FreadyFish have you got any progress yet? https://github.com/4z0t/FAF-UI-Mods/blob/dev/aka_v01/mods/AKA/Main.lua
-
@zer0d4y I have completely missed this! Been busy with an OpenRA mod of mine, so no unfortunatelly I didnt do much at all. Barely even played (shameful)
What about you? Any new ideas? Seems like a good start!
-
@FreadyFish It is being integrated https://github.com/FAForever/fa/pull/5755
-
Hey, want to get your thoughts on some further ideas here.
I'm thinking to create a dialog, possibly opened from a new button in the default hotkeys page. From there I imagine a set of tabs for the different contexts, like for engineers or factories selected. In each tab it's possible to create commands for that context, even chain link several commands to run in sequence (for example: select all TML + Group scatter + enter launch mode). In the end you can create a set of finely tuned hotkeys from all possible default hotkeys commands.
As the next step i imagine an import function where users can share their hotkeys either for all or specific contexts. Maybe someone likes my engineer hotkeys, and your factory hotkeys - should be possible to mix. When importing it would be nice to be able to convert between different keyboard layouts (languages) so it gets the same placement.
I think it will be an awesome project, worthy of integration. It would be great to get your help. You in on giving it a try?