From taleinat at gmail.com Fri Oct 13 17:41:39 2006 From: taleinat at gmail.com (Tal Einat) Date: Fri, 13 Oct 2006 17:41:39 +0200 Subject: [Idle-dev] C-k and C-y keybinding In-Reply-To: <20060927155620.F413612A960@localhost.localdomain> References: <20060927155620.F413612A960@localhost.localdomain> Message-ID: <7afdee2f0610130841l6cc4ed07wa8b2c3d83766aafb@mail.gmail.com> On 9/27/06, David MacKay wrote: [snip] > 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 From kbk at shore.net Mon Oct 16 05:35:20 2006 From: kbk at shore.net (Kurt B. Kaiser) Date: Sun, 15 Oct 2006 23:35:20 -0400 Subject: [Idle-dev] C-k and C-y keybinding In-Reply-To: <7afdee2f0610130841l6cc4ed07wa8b2c3d83766aafb@mail.gmail.com> (Tal Einat's message of "Fri, 13 Oct 2006 17:41:39 +0200") References: <20060927155620.F413612A960@localhost.localdomain> <7afdee2f0610130841l6cc4ed07wa8b2c3d83766aafb@mail.gmail.com> Message-ID: <87ac3x0w7b.fsf@hydra.bayview.thirdcreek.com> "Tal Einat" writes: > So, first and foremost - does anyone know how to overcome the Text > widget's default binding for Ctrl+k? Simply use the Options / Configure IDLE / Keys dialog to rebind Ctrl+k to a new event you will define. That will shadow Tk's kill binding, so long as you end your method with 'return "break"' so the Ctrl-k won't get passed to Tk. Then implement a method in EditorWindow to select from the insertion point to the end of the line and call EditorWindow.cut() (or copy that code :) to get it into the clipboard. Should work. Send me a patch :-) -- KBK From jonshan at winlab.rutgers.edu Mon Oct 23 20:43:19 2006 From: jonshan at winlab.rutgers.edu (Jonathan Shan) Date: Mon, 23 Oct 2006 14:43:19 -0400 (EDT) Subject: [Idle-dev] Scroll using mousewheel Message-ID: Hello all, How do I scroll in the editor and shell using mousewheel? I can scroll using the mousewheel only when the cursor is over the scroll bar on the right. Jonathan Shan