ManaUser wrote: Thu Mar 14, 2019 7:00 pm
Out of curiosity, since I'm the kind of guy who likes to customize controls significantly sometimes, can you provide any more details on how this is handled now? Like what sort of actions I can expect to be able to combine safely?
Honestly, it's so complicated not even we understand sometimes.

We have 3 main mechanisms:
1. input actions triggered by input events. When an event is triggered, we go through a priority list.
If an item in the list is valid for the input event and the event is valid for the game state, the event is consumed and the actions below are ignored.
I attached a text file with the code we define the list.
Now there are some rules.
- Sometimes it's hard to detect if an input is valid. For example the event for Enter Vehicle will always be consumed, since at this part of the code we don't search for entities to see if the player is near a vehicle.
- If the key combination is the same as a key combination that is used in the GUI, and the mouse is over a GUI, then the action will not be triggered.
2. GUI actions. These are shortcuts that are used in the GUI such are inventory transfer shortcuts, craft X, cancel craft, open item. If the mouse is over a gui and the corect key combination is active, these action trigger.
3. input state based on the state of the keyboard/mouse(e.g. W is pressed down so we walk up).
This includes mining, building, walking, picking up items, shooting, repairing. These don't generally conflict with any of the above shortcuts.
There are way more rules but hopefully this makes sense.