[Idle-dev] C-k and C-y keybinding

Tal Einat taleinat at gmail.com
Fri Oct 13 17:41:39 CEST 2006

On 9/27/06, David MacKay <mackay at aims.ac.za> wrote:

> in IDLE with unix-like keybinding,
> C-k successfully kills the line, but does not put it into
> the cut-buffer, so C-y does not retrieve the killed object.
> How can I modify IDLE to that C-k is the correct "kill and
> put in the cut/paste buffer"?

I tried to achieve this recently, and discovered that IDLE ignores
configurations for Ctrl+k. Ctrl+k kills a line in IDLE no matter which key
bindings you use, since this is a default key binding of Tkinter's Text
widget which is used by IDLE.

What would need to be done is to disable/override the Text widget's default
key binding - I don't know how to do this, I tried a bit but failed. With
this done, we would need to bind Ctrl+k to a new "kill line" function, which
removes the current line and puts it into the clipboard. This
could implement Emacs-like behavior, where subsequent lines killed are added
to the clipboard instead of replacing it.

So, first and foremost - does anyone know how to overcome the Text widget's
default binding for Ctrl+k?

-- And another question:   I see that "C-w" is "cut";
> but how can I create and extend the region to be cut, using
> just the keyboard?  In emacs, we use C-SPACE then C-w
> to set mark and cut region.   Is there an equivalent to
> C-SPACE in idle?

Press and hold down SHIFT, move the cursor to the other end of the region
you wish to select, release SHIFT. (This is quite standard and works in most
text-editing apps.)

Thanks very much

HTH :)
(sorry for the delayed response, I was on vacation)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/idle-dev/attachments/20061013/b5487dd4/attachment.htm 

More information about the IDLE-dev mailing list