Closed hogsy closed 5 years ago
See if you can spot the problem...
case SDL_KEYUP:
case SDL_KEYDOWN: {
if(io.WantCaptureKeyboard) {
int key = event.key.keysym.scancode;
IM_ASSERT(key >= 0 && key < IM_ARRAYSIZE(io.KeysDown));
io.KeysDown[key] = (event.type == SDL_KEYDOWN);
io.KeyShift = ((SDL_GetModState() & KMOD_SHIFT) != 0);
io.KeyCtrl = ((SDL_GetModState() & KMOD_CTRL) != 0);
io.KeyAlt = ((SDL_GetModState() & KMOD_ALT) != 0);
io.KeySuper = ((SDL_GetModState() & KMOD_GUI) != 0);
break;
}
int key = TranslateSDLKey(event.key.keysym.sym);
if(key != -1) {
Input_SetKeyState(key, (event.type == SDL_KEYDOWN));
}
} break;
No? User hits enter, key is up and ImGui no longer wants input - we never tell it that the key was released.
Fixed
When entering text into a field, this works fine, however as soon as you hit enter it looks like ImGui gets locked into a stage of thinking the enter key is still pressed?