[client] all: use the defined keyboard mapping for keybinds

Fixes #1007
This commit is contained in:
Geoffrey McRae
2022-06-29 18:24:53 +10:00
parent ed0cae84c8
commit da04a6dd54
12 changed files with 151 additions and 76 deletions

View File

@@ -53,7 +53,7 @@ static void fps_earlyInit(void)
static bool fps_init(void ** udata, const void * params)
{
app_registerKeybind(KEY_D, showFPSKeybind, NULL, "FPS display toggle");
app_registerKeybind(0, 'D', showFPSKeybind, NULL, "FPS display toggle");
showFPS = option_get_bool("win", "showFPS");
return true;
}

View File

@@ -78,7 +78,7 @@ static void graphs_earlyInit(void)
static bool graphs_init(void ** udata, const void * params)
{
app_overlayConfigRegister("Performance Metrics", configCallback, NULL);
app_registerKeybind(KEY_T, showTimingKeybind, NULL,
app_registerKeybind(0, 'T', showTimingKeybind, NULL,
"Show frame timing information");
return true;
}

View File

@@ -63,14 +63,20 @@ static int help_render(void * udata, bool interactive, struct Rect * windowRects
igTableNextColumn();
igText("Toggle capture mode");
for (int i = 0; i < KEY_MAX; ++i)
if (g_state.keyDescription[i])
{
igTableNextColumn();
igText("%s+%s", escapeName, linux_to_display[i]);
igTableNextColumn();
igText(g_state.keyDescription[i]);
}
KeybindHandle handle;
ll_forEachNL(g_state.bindings, item, handle)
{
if (!handle->description)
continue;
igTableNextColumn();
if (handle->sc)
igText("%s+%s", escapeName, linux_to_display[handle->sc]);
else
igText("%s+%c", escapeName, handle->charcode);
igTableNextColumn();
igText(handle->description);
}
igEndTable();
}