Same issue, but I was hoping to take it a step farther.
While this solution prevented nifty from consuming the input, it does not prevent nifty from making use of the input event. Is there a way to prevent this?
That is to say, while pressing the up key a character on the screen will move forward but nifty will also be switching focus on any buttons. And if the enter key is bound to an action it will also trigger whatever nifty button happens to have focus.
With your code, both my input manager & nifty are receiving the key event.
Without your code, only nifty receives the key event
Nifty binds the following keys automatically:
The arrow keys & tab key will cycle focus on nifty controls
And the enter/return key will execute a nifty control, such as a button, if it has focus.
I was looking for a way to disable this behavior.
I may have found a solution,
which was to remove the “focusable” flag in the .xml for all nifty controls on my screen. I’m not sure if nifty is making use of any other keys that I don’t know about, but for the moment this seems to be a good workaround.