rem: TextBlock *tb = tPtr->currentTextBlock; int x = tPtr->cursor.x + tPtr->visible.x; int y = tPtr->visible.y + tPtr->cursor.y + tPtr->cursor.h; int w, pos;
context: handleTextKeyPress(Text *tPtr, XEvent *event){    char buffer[2];    KeySym ksym;    int control_pressed = False;//    int h=1;    if (((XKeyEvent *) event)->state & ControlMask)        control_pressed = True;    buffer[XLookupString(&event->xkey, buffer, 1, &ksym, NULL)] = 0;        switch(ksym) {        case XK_Right: WMScrollText(tPtr, -14);        case XK_Left: {            TextBlock *tb = tPtr->currentTextBlock;            int x = tPtr->cursor.x + tPtr->visible.x;            int y = tPtr->visible.y + tPtr->cursor.y + tPtr->cursor.h;            int w, pos;#if 0            if(!tb)                break;            if(tb->graphic) {                if(tb->object) {                    w = WMWidgetWidth(tb->d.widget);                } else {                    w = tb->d.pixmap->width;                }            } else {                pos = tPtr->tpos;                w = WMWidthOfString(tb->d.font, &tb->text[pos], 1);            }            cursorToTextPosition(tPtr, w + tPtr->cursor.x + tPtr->visible.x,                 3 + tPtr->visible.y + tPtr->cursor.y                     + tPtr->cursor.h - tPtr->vpos);            if(x == tPtr->cursor.x + tPtr->visible.x) { printf("same %d %d\n", x, tPtr->cursor.x + tPtr->visible.x);                cursorToTextPosition(tPtr, tPtr->visible.x,                 3 + tPtr->visible.y + tPtr->cursor.y + tPtr->cursor.h);            }            paintText(tPtr);        #endif        }        break;        case XK_Down:            cursorToTextPosition(tPtr, tPtr->cursor.x + tPtr->visible.x,                 tPtr->clicked.y + tPtr->cursor.h - tPtr->vpos);            paintText(tPtr);                    break;        case XK_Up:              cursorToTextPosition(tPtr, tPtr->cursor.x + tPtr->visible.x,                 tPtr->visible.y + tPtr->cursor.y - tPtr->vpos - 3);            paintText(tPtr);                break;        case XK_BackSpace:        case XK_Delete:        case XK_KP_Delete:            deleteTextInteractively(tPtr, ksym);        break;        case XK_Control_R :        case XK_Control_L :            control_pressed = True;        break;        case XK_Return:            buffer[0] = '\n';        default:        if (buffer[0] != 0 && !control_pressed) {            insertTextInteractively(tPtr, buffer, 1);        } else if (control_pressed && ksym==XK_r) {            Bool i = !tPtr->flags.rulerShown;             WMShowTextRuler(tPtr, i);            tPtr->flags.rulerShown = i;         }           else if (control_pressed && buffer[0] == '')                 XBell(tPtr->view->screen->display, 0);    }    if (!control_pressed && tPtr->flags.ownsSelection)         releaseSelection(tPtr);}