Add comment

This commit is contained in:
bloeys
2024-04-12 23:57:24 +04:00
parent b060dcdbe9
commit 524ef068f0

View File

@ -39,6 +39,12 @@ func (w *Window) handleInputs() {
imguiCaptureMouse := imIo.WantCaptureMouse()
imguiCaptureKeyboard := imIo.WantCaptureKeyboard()
// These two are to fix a bug where state isn't cleared
// even after imgui captures the keyboard/mouse.
//
// For example, if player is moving due to key held and then imgui captures the keyboard,
// the player keeps moving even when the key is no longer pressed because the input system never
// receives the key up event.
if imguiCaptureMouse {
input.ClearMouseState()
}