ggerganov/imgui-ws

Web keyCode seem not compatible with imgui IO.KeysDown

Eragon-Brisingr opened this issue · 4 comments

When i test ctrl event, ctrl event not enable.
I think key id is not compatible.
open demo-null and "Inputs Navigation & Focus" -> "Keyboard, Gamepad & Navigation State"

  1. pressed x, name is right
  2. pressed s, name is wrong, and not high light in virtual keyboard

Thanks for reporting this. I guess the key mapping code needs some attention:

case ImGuiWS::Event::KeyUp:
{
if (event.clientId == curIdControl) {
if (event.key > 0) {
lastKeysDown[event.key] = false;
}
}
}
break;
case ImGuiWS::Event::KeyDown:
{
if (event.clientId == curIdControl) {
if (event.key > 0) {
lastKeysDown[event.key] = true;
}
}
}
break;

Should be fixed now on latest master (make sure to update the imgui submodule)

Nice, Good job! Thank you fix it, and do you have some idea to apply ImGui VtxOffset?