if (event.keyCode == 0) { switch (keyEvent.keyval) { case OS.GDK_ISO_Left_Tab: 	event.character = '\t'; break; case OS.GDK_Scroll_Lock:		event.character = 0x14; break; default: event.character = (char) keyEvent.keyval; } }
void sendKeyEvent (int type, int gdkEvent) {	GdkEventKey keyEvent = new GdkEventKey ();	OS.memmove (keyEvent, gdkEvent, GdkEventKey.sizeof);	int time = keyEvent.time;	int length = keyEvent.length;	if (length == 0) {		Event event = new Event ();		event.time = time;		setInputState (event, gdkEvent);		event.keyCode = Display.translateKey (keyEvent.keyval);		postEvent (type, event);	} else {		int string = keyEvent.string;		byte [] buffer = new byte [length];		OS.memmove (buffer, string, length);		char [] result = Converter.mbcsToWcs (null, buffer);		int index = 0;		while (index < result.length) {			if (result [index] == 0) break;			Event event = new Event ();			event.time = time;			event.character = result [index];			setInputState (event, gdkEvent);			postEvent (type, event);			index++;		}	}}