[client] overlay: show layout-translated hotkey labels
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled

Related to #1298
This commit is contained in:
Geoffrey McRae
2026-07-30 10:30:47 +10:00
parent e754f5841e
commit a9b8f437d4
7 changed files with 66 additions and 4 deletions

View File

@@ -56,7 +56,11 @@ static int help_render(void * udata, bool interactive, struct Rect * windowRects
if (igBeginTable("Help", 2, 0, (ImVec2) { 0.0f, 0.0f }, 0.0f))
{
char escapeLabel[8];
const char * escapeName = linux_to_display[g_params.escapeKey];
if (g_state.ds->getKeyLabel(
g_params.escapeKey, escapeLabel, sizeof(escapeLabel)))
escapeName = escapeLabel;
igTableNextColumn();
igText("%s", escapeName);
@@ -69,8 +73,13 @@ static int help_render(void * udata, bool interactive, struct Rect * windowRects
if (!handle->description)
continue;
char keyLabel[8];
const char * keyName = linux_to_display[handle->sc];
if (g_state.ds->getKeyLabel(handle->sc, keyLabel, sizeof(keyLabel)))
keyName = keyLabel;
igTableNextColumn();
igText("%s+%s", escapeName, linux_to_display[handle->sc]);
igText("%s+%s", escapeName, keyName);
igTableNextColumn();
igTextUnformatted(handle->description, NULL);
}