What is a good way for me to detect that an enter key has been clicked? Currently I’m thinking the <Interact> and OnClickAlternateKey attribute might be useful…
What is a good way for me to detect that an enter key has been clicked? Currently I’m thinking the <Interact> and OnClickAlternateKey attribute might be useful…
Thanks
hey paladinKetchup,
i remember using this for handling the chat, well i did like untothebreach said, i used an event subscriber on my input control.
[java]@NiftyEventSubscriber(id = “myTextField”)
public void onMyTextFieldInputEvent(final String id,
final NiftyInputEvent event) {
if (NiftyInputEvent.SubmitText.equals(event)) {
// Do Something
}
}[/java]
@navycougar said:
hey paladinKetchup,
i remember using this for handling the chat, well i did like untothebreach said, i used an event subscriber on my input control.
[java]@NiftyEventSubscriber(id = “myTextField”)
public void onMyTextFieldInputEvent(final String id,
final NiftyInputEvent event) {
if (NiftyInputEvent.SubmitText.equals(event)) {
// Do Something
}
}[/java]
thanks for the reply mate. but where and how do i specify that the “event” was a enter key?