Key Typed event?

Hi,
I understand Key up and Key down events in LWJGL, but I want to be able to type text (like for chat) in the game the same way as you would type in notepad or whatever. And only adding characters when a key is lifted up doesn’t work well at all. How can I do this?

Thanks,
roland

Found it:


Keyboard.enableRepeatEvents(true);
		for (int i = 0; i < KeyUp.length; i++)
			KeyUp[i] = false;
		
		while (Keyboard.next()) 
		{
			int key = Keyboard.getEventKey();
			if (key >= Keyboard.getKeyCount())
				continue;
			if (Keyboard.isRepeatEvent())
				KeyUp[key] = true;
			else
		    if (Keyboard.getEventKeyState()) 
		    {
		    	KeyDown[key] = true;
		    	KeyUp[key] = true;
		    } 
		    else 
		    {
		    	KeyDown[key] = false;
		    }
		}