if (OS.IsDBLocale) {
if (!OS.IsUnicode && OS.IsDBLocale) {
boolean sendKeyEvent (int type, int msg, int wParam, int lParam, Event event) {	if (!super.sendKeyEvent (type, msg, wParam, lParam, event)) {		return false;	}	if ((style & SWT.READ_ONLY) != 0) return true;	if (type != SWT.KeyDown) return true;	if (msg != OS.WM_CHAR && msg != OS.WM_KEYDOWN && msg != OS.WM_IME_CHAR) {		return true;	}	if (event.character == 0) return true;//	if (!hooks (SWT.Verify) && !filters (SWT.Verify)) return true;	char key = event.character;	int stateMask = event.stateMask;		/*	* Disable all magic keys that could modify the text	* and don't send events when Alt, Shift or Ctrl is	* pressed.	*/	switch (msg) {		case OS.WM_CHAR:			if (key != 0x08 && key != 0x7F && key != '\r' && key != '\t' && key != '\n') break;			// FALL THROUGH		case OS.WM_KEYDOWN:			if ((stateMask & (SWT.ALT | SWT.SHIFT | SWT.CONTROL)) != 0) return false;			break;	}	/*	* If the left button is down, the text widget refuses the character.	*/	if (OS.GetKeyState (OS.VK_LBUTTON) < 0) {		return true;	}	/* Verify the character */	String oldText = "";	int [] start = new int [1], end = new int [1];	OS.SendMessage (hwndText, OS.EM_GETSEL, start, end);	switch (key) {		case 0x08:	/* Bs */			if (start [0] == end [0]) {				if (start [0] == 0) return true;				start [0] = start [0] - 1;				if (OS.IsDBLocale) {					int [] newStart = new int [1], newEnd = new int [1];					OS.SendMessage (hwndText, OS.EM_SETSEL, start [0], end [0]);					OS.SendMessage (hwndText, OS.EM_GETSEL, newStart, newEnd);					if (start [0] != newStart [0]) start [0] = start [0] - 1;				}				start [0] = Math.max (start [0], 0);			}			break;		case 0x7F:	/* Del */			if (start [0] == end [0]) {				int length = OS.GetWindowTextLength (hwndText);				if (start [0] == length) return true;				end [0] = end [0] + 1;				if (OS.IsDBLocale) {					int [] newStart = new int [1], newEnd = new int [1];					OS.SendMessage (hwndText, OS.EM_SETSEL, start [0], end [0]);					OS.SendMessage (hwndText, OS.EM_GETSEL, newStart, newEnd);					if (end [0] != newEnd [0]) end [0] = end [0] + 1;				}				end [0] = Math.min (end [0], length);			}			break;		case '\r':	/* Return */			return true;		default:	/* Tab and other characters */			if (key != '\t' && key < 0x20) return true;			oldText = new String (new char [] {key});			break;	}	String newText = verifyText (oldText, start [0], end [0], event);	if (newText == null) return false;	if (newText == oldText) return true;	TCHAR buffer = new TCHAR (getCodePage (), newText, true);	OS.SendMessage (hwndText, OS.EM_SETSEL, start [0], end [0]);	OS.SendMessage (hwndText, OS.EM_REPLACESEL, 0, buffer);	return false;}