[plt-scheme] Re: How to remap keybinding "(c:j)" from "newline" to "newline-and-indent"?

From: Benjamin L.Russell (DekuDekuplex at Yahoo.com)
Date: Wed Apr 1 23:22:02 EDT 2009

On Wed, 1 Apr 2009 13:34:03 -0400, Anthony Cowley
<acowley at seas.upenn.edu> wrote:

>> Based on the information in the blog, I constructed the following
>> mykeys.ss file:
>>
>> --
>> (module mykeys
>> (lib "keybinding-lang.ss" "framework")
>>
>> ; Adds DrScheme Specific functions to the
>> ; available functions we can bind to.
>> (require (lib "tool-lib.ss" "drscheme"))
>>
>> (keybinding "c:j"
>> (lambda (editor event)
>> ?(begin
>> ? ?(newline)
>> ? ?(tabify-at-caret)))))
>> --
>
>Does this do what you want?
>
>(keybinding "c:j" (lambda (editor event)
>                    (send editor insert #\newline)
>                    (send
>                        (send editor get-keymap)
>                        call-function
>                        "tabify-at-caret"
>                        editor event #t)))

Although slightly slow in calling "tabify-at-caret", otherwise, it
does do what I wish.

Thank you for the code.  It solves the problem for now.

If I need another keybinding and can't figure it out from the
information provided in the  "Scheme from the Florida Keys:
Keybinding in DrScheme Explained" (see
http://schemekeys.blogspot.com/2007/05/keybinding-101-in-drscheme.html)
blog entry, I'll ask here again.  Thanks.

-- Benjamin L. Russell
-- 
Benjamin L. Russell  /   DekuDekuplex at Yahoo dot com
http://dekudekuplex.wordpress.com/
Translator/Interpreter / Mobile:  +011 81 80-3603-6725
"Furuike ya, kawazu tobikomu mizu no oto." 
-- Matsuo Basho^ 



Posted on the users mailing list.