VOXEDIT: The GUI goes crazy when press the key arrows and it is in edit mode
should fix issue #142master
parent
355b9e9bf4
commit
73511cbae7
|
@ -122,6 +122,7 @@ bool IMGUIApp::onKeyPress(int32_t key, int16_t modifier) {
|
|||
ev.key.keysym.sym = (SDL_Keycode)key;
|
||||
ev.key.keysym.mod = modifier;
|
||||
ImGui_ImplSDL2_ProcessEvent(&ev);
|
||||
_keys.insert(key);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -130,13 +131,14 @@ bool IMGUIApp::onKeyRelease(int32_t key, int16_t modifier) {
|
|||
if (_console.isActive()) {
|
||||
return true;
|
||||
}
|
||||
if (!Super::onKeyRelease(key, modifier)) {
|
||||
if (!Super::onKeyRelease(key, modifier) || _keys.has(key)) {
|
||||
SDL_Event ev {};
|
||||
ev.type = SDL_KEYUP;
|
||||
ev.key.keysym.scancode = (SDL_Scancode)SDL_SCANCODE_UNKNOWN;
|
||||
ev.key.keysym.sym = key;
|
||||
ev.key.keysym.mod = modifier;
|
||||
ImGui_ImplSDL2_ProcessEvent(&ev);
|
||||
_keys.remove(key);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ private:
|
|||
using Super = video::WindowedApp;
|
||||
void loadFonts();
|
||||
protected:
|
||||
core::Set<int32_t> _keys;
|
||||
core::VarPtr _renderUI;
|
||||
core::VarPtr _showMetrics;
|
||||
core::VarPtr _uiFontSize;
|
||||
|
|
Loading…
Reference in New Issue