This is what appears LWJGL needs to do....
If I remember correctly, LWJGL uses WM_CHAR, so based this off of that. I didn't test any of this...
WM_CHAR:{
// also may need to stick bit 30 on the end of scanCode to indicate up/down
int scanCode = (lParam>>16)&0xFF;
int virtualKey = MapVirtualKey(scanCode,MAPVK_VSC_TO_VK_EX);
BYTE states[256];
GetKeyboardState(states);
WCHAR buffer[10];
int result = ToUnicode(virtualKey,scanCode,states,buffer,10,0);
if(result < 0) {
// Ignore this key; it's a dead char
}
else {
// Process this key!
}
}break;
This may work; would have to test. Based on research it should. It may be easier to just process WM_KEYDOWN's and translate those with ToUnicode (you don't lose any of the functionality of WM_CHAR I believe).
I hope the equivalent keyboard Linux code works fine for this. I'm probably never going to install another Keyboard layout, so I won't look into suggesting fixed code for that unless it crops up as a bug on the forums.
LWJGL really needs a QA person for each OS haha. And then also a different forum for tracking bugs and posting fixes for each OS.
NOTE: this code is missing necessary checks like if scanCode is 0, etc., that would be necessary for production.