diff --git a/VERSION b/VERSION index 1a008949..bfaef0c6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.560 +8.3.561 diff --git a/graphics/grTCairo1.c b/graphics/grTCairo1.c index a3f99563..2a6cb0ce 100644 --- a/graphics/grTCairo1.c +++ b/graphics/grTCairo1.c @@ -546,7 +546,7 @@ XEvent *xevent; break; case KeyPress: { - int keywstate, keymod, idx, idxmax; + int keywstate, keymod, modifier, idx, idxmax; char inChar[10]; Tcl_Channel outChannel = Tcl_GetStdChannel(TCL_STDOUT); @@ -569,6 +569,7 @@ keys_and_buttons: #else keymod |= (Mod1Mask & KeyPressedEvent->state); #endif + modifier = keymod; if (nbytes == 0) /* No ASCII equivalent */ { @@ -631,71 +632,81 @@ keys_and_buttons: if ((LocRedirect == TX_INPUT_REDIRECTED) && TxTkConsole) { #if TCL_MAJOR_VERSION < 9 - Tcl_SavedResult state; + Tcl_SavedResult state; #else - Tcl_InterpState state; + Tcl_InterpState state; #endif - static char outstr[] = "::tkcon::Insert .text \"x\" "; + static char outstr[] = "::tkcon::Insert .text \"x\" "; - switch (keysym) - { + switch (keysym) + { case XK_Return: - TxSetPoint(KeyPressedEvent->x, - grXtransY(mw, KeyPressedEvent->y), - mw->w_wid); - TxInputRedirect = TX_INPUT_PROCESSING; - Tcl_EvalEx(consoleinterp, "::tkcon::Eval .text", + TxSetPoint(KeyPressedEvent->x, + grXtransY(mw, KeyPressedEvent->y), + mw->w_wid); + TxInputRedirect = TX_INPUT_PROCESSING; + Tcl_EvalEx(consoleinterp, "::tkcon::Eval .text", 19, 0); - TxInputRedirect = TX_INPUT_NORMAL; - TxSetPrompt('%'); + TxInputRedirect = TX_INPUT_NORMAL; + TxSetPrompt('%'); #if TCL_MAJOR_VERSION < 9 - Tcl_SaveResult(magicinterp, &state); + Tcl_SaveResult(magicinterp, &state); #else - state = Tcl_SaveInterpState(magicinterp, TCL_OK); + state = Tcl_SaveInterpState(magicinterp, TCL_OK); #endif - Tcl_EvalEx(magicinterp, "history event 0", 15, 0); - MacroDefine(mw->w_client, (int)'.', - Tcl_GetStringResult(magicinterp), NULL, - FALSE); + Tcl_EvalEx(magicinterp, "history event 0", 15, 0); + MacroDefine(mw->w_client, (int)'.', + Tcl_GetStringResult(magicinterp), NULL, + FALSE); #if TCL_MAJOR_VERSION < 9 - Tcl_RestoreResult(magicinterp, &state); + Tcl_RestoreResult(magicinterp, &state); #else - Tcl_RestoreInterpState(magicinterp, state); + Tcl_RestoreInterpState(magicinterp, state); #endif - break; + break; case XK_Up: - Tcl_EvalEx(consoleinterp, "::tkcon::Event -1", - 17, 0); - break; + Tcl_EvalEx(consoleinterp, "::tkcon::Event -1", + 17, 0); + break; case XK_Down: - Tcl_EvalEx(consoleinterp, "::tkcon::Event 1", - 16, 0); - break; + Tcl_EvalEx(consoleinterp, "::tkcon::Event 1", + 16, 0); + break; case XK_Left: - Tcl_EvalEx(consoleinterp, ".text mark set insert " - "insert-1c ; .text see insert", 50, 0); - break; + Tcl_EvalEx(consoleinterp, ".text mark set insert " + "insert-1c ; .text see insert", 50, 0); + break; case XK_Right: - Tcl_EvalEx(consoleinterp, ".text mark set insert " - "insert+1c ; .text see insert", 50, 0); - break; + Tcl_EvalEx(consoleinterp, ".text mark set insert " + "insert+1c ; .text see insert", 50, 0); + break; case XK_BackSpace: case XK_Delete: - Tcl_EvalEx(consoleinterp, ".text delete insert-1c ;" - ".text see insert", 40, 0); - break; + Tcl_EvalEx(consoleinterp, ".text delete insert-1c ;" + ".text see insert", 40, 0); + break; case XK_quotedbl: case XK_backslash: case XK_bracketleft: - outstr[23] = '\\'; - outstr[24] = inChar[idx]; - outstr[25] = '\"'; - Tcl_EvalEx(consoleinterp, outstr, 26, 0); - outstr[24] = '\"'; - outstr[25] = '\0'; + outstr[23] = '\\'; + outstr[24] = inChar[idx]; + outstr[25] = '\"'; + Tcl_EvalEx(consoleinterp, outstr, 26, 0); + outstr[24] = '\"'; + outstr[25] = '\0'; + /* fall through */ default: + /* Handle Ctrl-u: Delete entire command */ + if ((keysym == XK_u) && (modifier == ControlMask)) + { + Tcl_EvalEx(consoleinterp, ".text delete limit end", + 22, 0); + } + else + { outstr[23] = inChar[idx]; Tcl_EvalEx(consoleinterp, outstr, 25, 0); - break; - } + } + break; + } } else if (LocRedirect == TX_INPUT_REDIRECTED) { int tl; diff --git a/graphics/grTOGL1.c b/graphics/grTOGL1.c index 7849f659..1b64c548 100644 --- a/graphics/grTOGL1.c +++ b/graphics/grTOGL1.c @@ -550,7 +550,7 @@ TOGLEventProc(clientData, xevent) break; case KeyPress: { - int keywstate, keymod, idx, idxmax; + int keywstate, keymod, modifier, idx, idxmax; char inChar[10]; Tcl_Channel outChannel = Tcl_GetStdChannel(TCL_STDOUT); @@ -573,6 +573,7 @@ keys_and_buttons: #else keymod |= (Mod1Mask & KeyPressedEvent->state); #endif + modifier = keymod; if (nbytes == 0) /* No ASCII equivalent */ { @@ -588,6 +589,7 @@ keys_and_buttons: } else /* ASCII-valued character */ { + /* Remove single modifier (Control or Shift) */ if (!(keymod & (LockMask | Mod1Mask))) { if (!(keymod & ControlMask)) keymod &= ~ShiftMask; @@ -627,7 +629,7 @@ keys_and_buttons: case XK_Pointer_Button3: case XK_Pointer_Button4: case XK_Pointer_Button5: - LocRedirect = TX_INPUT_NORMAL;; + LocRedirect = TX_INPUT_NORMAL; break; } } @@ -695,9 +697,19 @@ keys_and_buttons: Tcl_EvalEx(consoleinterp, outstr, 26, 0); outstr[24] = '\"'; outstr[25] = '\0'; + /* fall through */ default: - outstr[23] = inChar[idx]; - Tcl_EvalEx(consoleinterp, outstr, 25, 0); + /* Handle Ctrl-u like tkcon: Delete entire command */ + if ((keysym == XK_u) && (modifier == ControlMask)) + { + Tcl_EvalEx(consoleinterp, ".text delete limit end", + 22, 0); + } + else + { + outstr[23] = inChar[idx]; + Tcl_EvalEx(consoleinterp, outstr, 25, 0); + } break; } } diff --git a/graphics/grTk1.c b/graphics/grTk1.c index 01c59d8c..ddbc80fa 100644 --- a/graphics/grTk1.c +++ b/graphics/grTk1.c @@ -793,7 +793,7 @@ MagicEventProc(clientData, xevent) break; case KeyPress: { - int keywstate, keymod, idx, idxmax; + int keywstate, keymod, modifier, idx, idxmax; char inChar[10]; Tcl_Channel outChannel = Tcl_GetStdChannel(TCL_STDOUT); @@ -820,6 +820,7 @@ keys_and_buttons: #else keymod |= (Mod1Mask & KeyPressedEvent->state); #endif + modifier = keymod; if (nbytes == 0) { @@ -951,9 +952,19 @@ keys_and_buttons: Tcl_EvalEx(consoleinterp, outstr, 26, 0); outstr[24] = '\"'; outstr[25] = '\0'; + /* fall through */ default: - outstr[23] = inChar[idx]; - Tcl_EvalEx(consoleinterp, outstr, 25, 0); + /* Handle Ctrl-u: Delete entire command */ + if ((keysym == XK_u) && (modifier == ControlMask)) + { + Tcl_EvalEx(consoleinterp, ".text delete limit end", + 22, 0); + } + else + { + outstr[23] = inChar[idx]; + Tcl_EvalEx(consoleinterp, outstr, 25, 0); + } break; } }