Open alextd opened 1 year ago
Nice catch, and valid observations about OnGUI. I have given your solution a try, but it seems like KeyDown events are not getting sent at all when an input field is focused.
Of course I hardly remember this, what seems to be my conclusion from debugging some odd problem
If it's not a simple fix ... nevermind then.
It's still relevant as of today so I'll keep this open in case someone suggests with a viable fix.
Apparently with Unity for some reason, when a
GUI.TextField
is focused, anyInput.GetKeyDown
returns false.HugsLibs is using
KeyBindingDef.JustPressed
that doesGetKeyDown
in OnGUI so I think it should useIsDownEvent
to catch these key presses via anEvent
.I also think after a little searching that
GetKeyDown
is for Unity mono behaviorUpdate()
and the events are forOnGUI()
so this change is probably just more correct in any case?So yah I have a textfield set up that explicitly ignores certain key events, does not call textfield for that, but the existence of the text field focus is the problem. Even if another window is in front and text cannot be entered, HugsLib still doesn't process keys with that focuses textinput. I end up opening the animals tab because I bound the restart hotkey to F5.