#2604 closed defect (fixed)
Hotkey editor
Reported by: | Adrian | Owned by: | wraitii |
---|---|---|---|
Priority: | Must Have | Milestone: | Alpha 24 |
Component: | UI – Miscellaneous | Keywords: | beta |
Cc: | azrdev@… | Patch: |
Description (last modified by )
F.e. in Greek, you have the following problem While in-game, if the system is switched to a Greek layout (and I'm guessing the bug would occur for any non-latin layouts), then the navigation (WASD) and view (QE) keys do not work. But regular users could also benefit by having customisable hotkeys.
Attachments (2)
Change History (17)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
Description: | modified (diff) |
---|---|
Summary: | letter keys (WASD navigation, etc) don't work with alternative keyboard layouts → Implement a GUI for setting the hotkeys |
You can adapt the hotkeys in the settings file (see Manual_Settings for more info). But you're right that we need a GUI for it, and possibly also detect it automatically depending on some system setting. Though that's hard, as for some keys the meaning is in the place it takes (like w is above s, so w is up and s is down, this doesn't make sense for an AZERTY). And sometimes, the meaning of the key is in the symbol (like F for "follow").
comment:3 by , 8 years ago
Cc: | added |
---|---|
Description: | modified (diff) |
comment:4 by , 8 years ago
1. Main Menu entry and Options page: Since hotkeys are logically part of the config system, the GUI to edit them should be a subset of the options dialog (this way the save, reset, revert and default button can be reused).
To establish some screen space in that options dialog, similar to tabbing a new button "Show hotkeys " ("Show Settings") could be added that will toggle between displaying the hotkeys and the other settings. A new main menu entry under "Tools & Options" pointing to "Hotkeys" can be added so that unfamiliar users find that link directly.
2. Translation: Both the hotkey names and the actual keys assigned to them should be presented in the currently selected language.
Hotkey names and description: Therefore we must grab those from a new translated json file. The object maps from "hotkey category identifier" that includes the title and description of that hotkey category. The category contains a map from "hotkey identifier" to the properties of the hotkey, i.e. title, description and config ID).
{ "selection": { "name": "Selection", "description": "Selecting units directly or selecting a subset when dragging", "hotkeys" : { "hotkey.selection.milonly": { "name": "Military units only" "description": "Add only military units to the selection" }, }, ... }, ... };
Notice the categories don't correspond exactly to the ones from default.cfg
but are only meant to ease interaction. (see 5)
SDL Keys:
KeyName.cpp
contains a struct that maps from SDL key to a proper (currently unused) name that should just be translated:
{ SDLK_SLASH, "/", TranslateWithContext("hotkey", "ForwardSlash") }, { SDLK_SEMICOLON, ";", TranslateWithContext("hotkey", "Semicolon") }, { SDLK_a, "A", TranslateWithContext("hotkey", "A") }, { SDLK_b, "B", TranslateWithContext("hotkey", "B") },
3. Hotkey page:
All available hotkeys should be shown in a table (olist
) as known from the lobby or replay menu. It will have a column for the hotkey name, one for the mapped key and potentialy one for the description (otherwise the description could be shown in a tooltip or label).
It needs a button to delete the hotkey (#3051) and
a button to set the key (should also happen when doubleclicking on that list item).
A temporary window should appear that prompts the user to press a key: 4. Hotkey input dialog: This will be a tricky one as it should disable all hotkeys globally and catch all keys pressed simultaneously until released (including shift, alt and escape).
It needs support for hotkey combinations, i.e. multiple keys pressed simultaneously (f.e. ctrl+1 to store a camera position).
(A sequence of hotkeys, f.e. B
to build something, H
to build a house as suggested in #1492 / #1312 / #1899 won't be handled inside this dialog. It should rather become two hotkeys.)
Once the user has released a button, the dialog will close automatically and return the pressed SDL hotkeys, which can be converted to ConfigDB entries using SKeycodeMapping
.
5. Optional: Hotkey filter dropdown
Since there are 147 hotkeys already, we could add a dropdown so that the user sees only a selected category ( all
, hotkey
, camera
, ...)
comment:5 by , 7 years ago
Keywords: | beta added |
---|
by , 6 years ago
Attachment: | screenshot1272.png added |
---|
comment:7 by , 5 years ago
Component: | Core engine → UI – Miscellaneous |
---|---|
Priority: | Should Have → Must Have |
This looks beautiful elexis. I hope we can have this in at some point!
comment:8 by , 5 years ago
elexis what do we need to do to get this on the game? If you want I can offer myself to review it (this week can't, next one sure) if you upload it to phab.
comment:9 by , 5 years ago
The Tax Court has stated that: "It is well established that an exempt organization is entitled to pay reasonable compensation for services without endangering its exemption" and that "the law places no duty on individuals operating charitable organizations to donate their services; they are entitled to reasonable compensation for their efforts."(World Family Corporation v. Commissioner, 81 T.C. 958, 969 (1983), Reasonable Compensation by Jean Wright and Jay H. Rotz).
comment:10 by , 5 years ago
Summary: | Implement a GUI for setting the hotkeys → Hotkey editor |
---|
comment:14 by , 3 years ago
Milestone: | Backlog → Alpha 24 |
---|
Additionally, on AZERTY keyboards, the keys should be changed to fit the layout (i.e. using ZQSD for navigation and AE for view).