CleverRaven/Cataclysm-DDA

Rule #2: double tap (UI keystroke saving suggestion)

Open

#52,890 opened on Nov 18, 2021

View on GitHub
 (6 comments) (12 reactions) (0 assignees)C++ (3,991 forks)batch import
(P3 - Medium)<Enhancement / Feature><Suggestion / Discussion>Controls / InputGood First IssueQuality of Life[C++]

Repository metrics

Stars
 (9,264 stars)
PR merge metrics
 (Avg merge 6d 5h) (292 merged PRs in 30d)

Description

Is your feature request related to a problem? Please describe.

Our UI is running out of keys, and key assignments with menus are starting to have a strong negative impact on the play experience. However, the complexity of our interactions and the need for clear commands to the system make it hard to separate out some keys, and for others, players get exceedingly angry when their motor memory is too dramatically changed.

Describe the solution you'd like

image

We should be using double keypresses in more instances to circumvent menus. Pressing the same key again to get a commonly-needed behaviour that isn't quite as major as the first press is a great way to quickly add new functions, and takes most of the extra time away from new keypresses.

To use some high profile examples:

  • Pressing g once should have the previous get behaviour - push a direction and get items in that tile only. Double-tap - pressing g again while in the directional mode - should give the new get behaviour, getting items from all around you. We get both worlds with minimal new keypresses.
  • Pressing e once should give the current interact behaviour. Double-tap from that setting should change to directional-get, allowing people to mostly keep their old habits intact with a little less relearning.
  • double-tap " from the posture select menu should toggle run/walk. (edit: it already does this, I forgot. All we need is to add the inheritance portion mentioned below).

Some other spots where this could be nice:

  • Double-tap while dropping to activate Directional drop, and press d again while directional-dropping to go back to drop. This doesn't have to replace the default binding of D, at least not initially, but allows another quick way to swap.
  • double tap while in the sleep menu to switch to the wait menu. double tap while in the wait menu to switch to the sleep menu.
  • double tap while in the crafting menu to switch to construction, or in the construction menu to switch to crafting.
  • double tap in the mutations menu to switch to cybernetics, and vice versa.

Smart inheritance

Most of this is just a keybindings issue, but @esotericist observed that there is some code support needed: the "double tap" should get code support such that if I remap interact to another key, say q, that other key is also automatically remapped to the double tap so that a q double tap now automatically switches to directional-get mode.

  • This code support would be even better if double-tap remembered what the first key you used was and kept that as the double tap key. So in the example above of sleep and wait menus toggling with double tap, the [ key would cycle you through if that's where you started, and $ would cycle you through if that's where you started.
  • Possibly the best way to accomplish this might be to have double_tap be a function run from the menu/interaction mode, not really a keybinding. So, if you're in get, directional mode and double-tap whatever got you into get, directional mode, you always switch to get, everywhere mode, regardless of keybindings. If you got to get, directional mode by double-tapping in interaction, then tapping the interaction key a third time would then take you to get, everywhere mode. However, if you press g to get to the get, directional mode setting, then pressing g again would get you that double-tap effect. For this, we just need a (standard, I hope?) method for saving which keystroke got you there and having that keystroke stored temporarily as your current "double-tap context key".

I think the examples I have given here are sufficient to start, but later we could start looking at expanding double tap to a bunch more areas and retrieving some of our less needed key bindings for later use.

Describe alternatives you've considered

This isn't something we need, specifically, but we do need something to start smoothing out our UI.

Additional context

I would also like to see the addition of selectable keysets that allow you to save and distribute your keybindings, and that intersects with this a little. I'll see about adding an issue some time.

Contributor guide