Anyone uses this?
It seems not to want to trigger here…
[xml]
<control name=“label” id=“pitchDown” text="${dialog.pitchDown}" textHAlign=“left” width=“90px”>
<interact onClick=“pitchDownEnable()” />
</control>
<control name=“textfield” id=“pitchDownKey” width=“50px” textHAlign=“center” align=“right”>
<interact onLostFocus=“pitchDownSave()”/>
</control>
[/xml]
[java]
public void pitchDownEnable() {
screen.findNiftyControl(“pitchDownKey”, TextField.class).enable();
screen.findNiftyControl(“pitchDownKey”, TextField.class).setFocus();
}
public void pitchDownSave() {
screen.findNiftyControl(“pitchDownKey”, TextField.class).disable();
// save key to GameSettings
}
[/java]
Maybe I’m doing it wrong?
Nifty’s wiki does say that:
onLostFocus The element just lost the keyboard/input focus.
So that shouldn't be a case of "it can't be disabled while it's got the focus." since this is supposed to trigger once it has lost the focus...
Checked the logger and no warning, nothing out of the ordinary... :/