C7-Game / Prototype

An early-stage, open-source 4X strategy game
https://c7-game.github.io/
MIT License
34 stars 9 forks source link

Create Keybinding System #168

Open pcen opened 2 years ago

pcen commented 2 years ago

Create a system around keybinding instead of checking keycodes directly in game logic.

This will make it easier to modify keybindings in the future or make them customizable.

Sean-Brown commented 2 years ago

When we implement this, do we want to allow the user to bind multiple keys to the same action? Like, in the current version of Civ 3, x and j both can be used for stack moving units, the arrow+fn and numpad keys can both be used to move units, etc. It may make the implementation of this ticket more difficult but would keep in line with what exists in the game right now.

WildWeazel commented 2 years ago

In general we want to be as faithful to Civ3 as possible, especially with the UI. So ultimately yes we should allow all the same configurations. And maybe this goes without saying, but look into how this is done with Godot before coding up something yourself.

pcen commented 2 years ago

https://docs.godotengine.org/en/3.4/classes/class_inputmap.html#inputmap