It sends three of them actually!
One for isPressed, one for isReleased and one for isRepeting at the same time.
in char callback, for each invoke, it creates two key input event, one for key pressed and one for key released. It seems like a mess!
glfwSetCharCallback(context.getWindowHandle(), charCallback = new GLFWCharCallback() {
@Override
public void invoke(final long window, final int codepoint) {
final char keyChar = (char) codepoint;
final KeyInputEvent pressed = new KeyInputEvent(KeyInput.KEY_UNKNOWN, keyChar, true, false);
pressed.setTime(getInputTimeNanos());
keyInputEvents.add(pressed);
final KeyInputEvent released = new KeyInputEvent(KeyInput.KEY_UNKNOWN, keyChar, false, false);
released.setTime(getInputTimeNanos());
keyInputEvents.add(released);
}
});
I made a quick test on lwjgl2, and it looks fine.