Lift the "This control has to be mouse related" restriction on certain bindings
No- it doesn't! Why on earth would it matter whether I press `t` or `Button 1`, it literally doesn't matter from a technical standpoint!I play the game entirely with a keyboard- why do you require me to map one of my keys to a mouse button?
Note: It is possible to circumvent the restriction by editing the config file, but it truly only works with buttons commonly found on a mouse, for whatever reason.
Allow binding a sequence of keys
It is convenient to keep related functionality under a common leading key because (1) it makes keybinds easier to remember and (2) you can fit more keybinds. For instance:- `op` for Open Production
- `om` for Open Map
- `ot` for Open Technology
- `tf` for Toggle Flashlight
- `tm` for Toggle Minimap
- `tq` for Toggle craftingQueue direction (add to front/back)
- `tr` for Toggle Running
- `tb` for Toggle Bots
and so on..
As far as I know, as a mod author, there are but two ways of achieving this at the moment:
1) Register every possible single key in `data.lua` and do the book-keeping yourself
2) Register the leading key only and use an off-screen gui textbox to register the second keypress
which brings us to another gripe I have with the current system:
Provide a way to listen to keypresses without having to register a callback in data.lua
Note: This is technically possible with an off-screen textbox- but that's a hack!Motivational example 1
Suppose I would like to write an autowalk function. The player can register his current location and then later use the built-in pathfinder to walk his character to that location. The bindings for this would be:
- `m_` to Mark a key _ - associating his current location with some arbitrary key _
- `w_` to Walk to the location associated with some arbitrary key _
Motivational example 2
In the vanilla game there are often several bindings for performing the same action different number of times (Transfer/craft 1/5/stack/all). In addition to this it would be nice to be able to specify exactly how many times I would like to perform an action. For instance:
- `11c` to Craft 11 more of the currently held item. `c` without count means 1
- `20q` to drop or insert into hovered entity 20 of the currently held item. `q` without count means 1
- `5f` to insert 5 items of Fuel into nearby machines. `f` without count means equally distribute
These are not contrived examples by the way- all of my examples are bindings that I currently have in a personal utility mod (registering every single key in the game in data.lua).
Provide separate key up/down events
The movement keys (defaults to WASD) have the unique property that they know when you release a key. This is not exposed to mod authors and so it is impossible for me to implement my own movement controls, for instance, because I have no way of knowing when a key is released and so I cannot tell when to stop walking.On a related note:
Unlimited alternate bindings
Suppose I would like 8-directional movement (additional keys for the diagonals). I could have achieved this by binding two cardinal directions to the same key, however, this requires 3 bindings per cardinal direction in total and I am limited to only 2. Which seems like an entirely arbitrary restriction.Why is there even a distinction between primary and alternative bindings? How about just allowing any action to be bound 0 or more times?