rem: if (!controled && !modified) {
add: if (!controled) {
context: handleTextFieldKeyPress(TextField *tPtr, XEvent *event){    char buffer[64];    KeySym ksym;    char *textEvent = NULL;    void *data = NULL;    int count, refresh = 0;    int control_pressed = 0;    int cancelSelection = 1;    Bool shifted, controled, modified;    Bool relay = True;    WMScreen *scr = tPtr->view->screen;    event->xkey.state &= ~scr->ignoredModifierMask;        /*printf("(%d,%d) -> ", tPtr->selection.position, tPtr->selection.count);*/    if (((XKeyEvent *) event)->state & WM_EMACSKEYMASK)	control_pressed = 1;        shifted = event->xkey.state & ShiftMask;    controled = event->xkey.state & ControlMask;    if ((event->xkey.state & ~(ShiftMask|ControlMask)) != 0) {	modified = True;    } else {	modified = False;    }    count = XLookupString(&event->xkey, buffer, 63, &ksym, NULL);    buffer[count] = '\0';        switch (ksym) {     case XK_Tab:#ifdef XK_ISO_Left_Tab     case XK_ISO_Left_Tab:#endif	if (!controled && !modified) {	    if (shifted) {		if (tPtr->view->prevFocusChain) {		    W_SetFocusOfTopLevel(W_TopLevelOfView(tPtr->view),					 tPtr->view->prevFocusChain);		    tPtr->flags.notIllegalMovement = 1;		}		data = (void*)WMBacktabTextMovement;	    } else {		if (tPtr->view->nextFocusChain) {		    W_SetFocusOfTopLevel(W_TopLevelOfView(tPtr->view),					 tPtr->view->nextFocusChain);		    tPtr->flags.notIllegalMovement = 1;		}		data = (void*)WMTabTextMovement;	    }	    textEvent = WMTextDidEndEditingNotification;	    relay = False;	}	break;     case XK_Escape:	if (!shifted && !controled && !modified) {	    data = (void*)WMEscapeTextMovement;	    textEvent = WMTextDidEndEditingNotification;	    	    relay = False;	}	break;     case XK_Return:	if (!shifted && !controled && !modified) {	    data = (void*)WMReturnTextMovement;	    textEvent = WMTextDidEndEditingNotification;	    	    relay = False;	}	break;     case WM_EMACSKEY_LEFT:	if (!control_pressed) {	    goto normal_key;	}#ifdef XK_KP_Left     case XK_KP_Left:#endif     case XK_Left:	if (!modified) {	    if (tPtr->cursorPosition > 0) {		paintCursor(tPtr);		if (event->xkey.state & ControlMask) {		    int i = tPtr->cursorPosition - 1;		    		    while (i > 0 && tPtr->text[i] != ' ') i--;		    while (i > 0 && tPtr->text[i] == ' ') i--;		    		    tPtr->cursorPosition = (i > 0) ? i + 1 : 0;		} else		    tPtr->cursorPosition--;				if (tPtr->cursorPosition < tPtr->viewPosition) {		    tPtr->viewPosition = tPtr->cursorPosition;		    refresh = 1;		} else		    paintCursor(tPtr);	    }	    if (event->xkey.state & ShiftMask)		cancelSelection = 0;	    	    relay = False;	}	break;    case WM_EMACSKEY_RIGHT:        if (!control_pressed) {            goto normal_key;        }#ifdef XK_KP_Right    case XK_KP_Right:#endif    case XK_Right:	if (!modified) {	    if (tPtr->cursorPosition < tPtr->textLen) {		paintCursor(tPtr);		if (event->xkey.state & ControlMask) {		    int i = tPtr->cursorPosition;		    		    while (tPtr->text[i] && tPtr->text[i] != ' ') i++;		    while (tPtr->text[i] == ' ') i++;		    		    tPtr->cursorPosition = i;		} else {		    tPtr->cursorPosition++;		}		while (WMWidthOfString(tPtr->font,				       &(tPtr->text[tPtr->viewPosition]),				       tPtr->cursorPosition-tPtr->viewPosition)		       > tPtr->usableWidth) {		    tPtr->viewPosition++;		    refresh = 1;		}		if (!refresh)		    paintCursor(tPtr);	    }	    if (event->xkey.state & ShiftMask)		cancelSelection = 0;	    	    relay = False;	}	break;	    case WM_EMACSKEY_HOME:        if (!control_pressed) {            goto normal_key;        }#ifdef XK_KP_Home    case XK_KP_Home:#endif    case XK_Home:	if (!modified && !controled) {	    if (tPtr->cursorPosition > 0) {		paintCursor(tPtr);		tPtr->cursorPosition = 0;		if (tPtr->viewPosition > 0) {		    tPtr->viewPosition = 0;		    refresh = 1;		} else		    paintCursor(tPtr);	    }	    if (event->xkey.state & ShiftMask)		cancelSelection = 0;	    	    relay = False;	}	break;	    case WM_EMACSKEY_END:        if (!control_pressed) {            goto normal_key;        }#ifdef XK_KP_End    case XK_KP_End:#endif    case XK_End:	if (!modified && !controled) {	    if (tPtr->cursorPosition < tPtr->textLen) {		paintCursor(tPtr);		tPtr->cursorPosition = tPtr->textLen;		tPtr->viewPosition = 0;		while (WMWidthOfString(tPtr->font,				       &(tPtr->text[tPtr->viewPosition]),				       tPtr->textLen-tPtr->viewPosition)		       > tPtr->usableWidth) {		    tPtr->viewPosition++;		    refresh = 1;		}		if (!refresh)		    paintCursor(tPtr);	    }	    if (event->xkey.state & ShiftMask)		cancelSelection = 0;	    	    relay = False;	}	break;	     case WM_EMACSKEY_BS:         if (!control_pressed) {             goto normal_key;         }     case XK_BackSpace:	if (!modified && !shifted && !controled) {	    if (tPtr->selection.count) {		WMDeleteTextFieldRange(tPtr, tPtr->selection);		data = (void*)WMDeleteTextEvent;		textEvent = WMTextDidChangeNotification;	    } else if (tPtr->cursorPosition > 0) {		WMRange range;		range.position = tPtr->cursorPosition - 1;		range.count = 1;		WMDeleteTextFieldRange(tPtr, range);		data = (void*)WMDeleteTextEvent;		textEvent = WMTextDidChangeNotification;	    }	    	    relay = False;	}	break;	    case WM_EMACSKEY_DEL:        if (!control_pressed) {            goto normal_key;        }#ifdef XK_KP_Delete    case XK_KP_Delete:#endif    case XK_Delete:	if (!modified && !controled && !shifted) {	    if (tPtr->selection.count) {		WMDeleteTextFieldRange(tPtr, tPtr->selection);		data = (void*)WMDeleteTextEvent;		textEvent = WMTextDidChangeNotification;	    } else if (tPtr->cursorPosition < tPtr->textLen) {		WMRange range;		range.position = tPtr->cursorPosition;		range.count = 1;		WMDeleteTextFieldRange(tPtr, range);		data = (void*)WMDeleteTextEvent;		textEvent = WMTextDidChangeNotification;	    }	    	    relay = False;        }	break;    normal_key:     default:	if (!controled && !modified) {	    if (count > 0 && isprint(buffer[0])) {		if (tPtr->selection.count)		    WMDeleteTextFieldRange(tPtr, tPtr->selection);		WMInsertTextFieldText(tPtr, buffer, tPtr->cursorPosition);		data = (void*)WMInsertTextEvent;		textEvent = WMTextDidChangeNotification;	    		relay = False;	    }        }	break;    }    if (relay) {	WMRelayToNextResponder(W_VIEW(tPtr), event);	return;    }    /* Do not allow text selection in secure text fields */    if (cancelSelection || tPtr->flags.secure) {        lostHandler(tPtr->view, XA_PRIMARY, NULL);        if (tPtr->selection.count) {            tPtr->selection.count = 0;            refresh = 1;        }        tPtr->selection.position = tPtr->cursorPosition;    } else {        if (tPtr->selection.count != tPtr->cursorPosition - tPtr->selection.position) {            tPtr->selection.count = tPtr->cursorPosition - tPtr->selection.position;            WMPostNotificationName("_lostOwnership", NULL, tPtr);            refresh = 1;        }    }    /*printf("(%d,%d)\n", tPtr->selection.position, tPtr->selection.count);*/    if (textEvent) {        WMNotification *notif = WMCreateNotification(textEvent, tPtr, data);        if (tPtr->delegate) {            if (textEvent==WMTextDidBeginEditingNotification &&                tPtr->delegate->didBeginEditing)                (*tPtr->delegate->didBeginEditing)(tPtr->delegate, notif);            else if (textEvent==WMTextDidEndEditingNotification &&                     tPtr->delegate->didEndEditing)                (*tPtr->delegate->didEndEditing)(tPtr->delegate, notif);            else if (textEvent==WMTextDidChangeNotification &&                     tPtr->delegate->didChange)                (*tPtr->delegate->didChange)(tPtr->delegate, notif);        }        WMPostNotification(notif);        WMReleaseNotification(notif);    }    if (refresh)	paintTextField(tPtr);    /*printf("(%d,%d)\n", tPtr->selection.position, tPtr->selection.count);*/}