Prototype icon indicating copy to clipboard operation
Prototype copied to clipboard

Generalize keyboard shortcuts

Open QuintillusCFC opened this issue 3 years ago • 5 comments

At some point we should generalize our keyboard shortcuts. Currently, many of these are configured in UnitButtons.cs (although there will eventually be a wider variety of other ones, e.g. Clear Map), and they are hard-coded to specific keys. This works great if you are used to the QWERTY layout and the English version of Civ, but if you have different layouts or languages, it may not be intuitive.

This item is to make a generalized system, so the configuration can be loaded from some sort of settings file, with the default one corresponding to English + QWERTY. Once that is set up, we can work with the community to create additional default options; for example there's an active German civ community that can likely contribute sensible defaults for that version fairly quickly once we can load them from a config file.

QuintillusCFC avatar Jul 29 '22 16:07 QuintillusCFC

This is done in the godot4 branch with pr https://github.com/C7-Game/Prototype/pull/405

pcen avatar Jul 05 '23 18:07 pcen

Not sure about closing this just yet as there's a configuration element that's still unimplemented. Maybe a follow-on task?

WildWeazel avatar Jul 08 '23 06:07 WildWeazel

I'm not sure this is finished on the Godot branch - I use Colemak keyboard and shortcuts are based on the position in the Qwerty keyboard. Shortcuts like Enter, Esc, etc, all work. However, if I want to build a road with a worker, I need to press "P", which is located where "R" is on Qwerty. Wouldn't setting the key bindings to the "Unicode" setting automatically make other (English) keyboard layouts work? I did some testing and that seemed to make key bindings work for me. @pcen thoughts on making this change?

benskywalker avatar Sep 22 '23 23:09 benskywalker

I'm not sure this is finished on the Godot branch - I use Colemak keyboard and shortcuts are based on the position in the Qwerty keyboard. Shortcuts like Enter, Esc, etc, all work. However, if I want to build a road with a worker, I need to press "P", which is located where "R" is on Qwerty. Wouldn't setting the key bindings to the "Unicode" setting automatically make other (English) keyboard layouts work? I did some testing and that seemed to make key bindings work for me. @pcen thoughts on making this change?

I didn't test on anything except the macbook keyboard, in fact I had no idea there's a unicode setting. Sounds like a great change!

pcen avatar Sep 22 '23 23:09 pcen

I'm all in favor of improved portability. Eventually there should be an in-game keymapping utility, but for now at least a single place in code to statically assign all keycodes.

WildWeazel avatar Sep 28 '23 04:09 WildWeazel