[racket] keybinding help needed

From: Bill Richter (richter at math.northwestern.edu)
Date: Tue Jul 27 10:36:36 EDT 2010

Thanks, Noel.  I figured it out by trial error, modifying the one
example from section 3.3.8 of the DrRacket: Programming Environment
manual.  I made a file kbd-bind.rkt:

#lang s-exp framework/keybinding-lang
(keybinding "f9" (λ (editor evt) (send editor save-file))) 
(keybinding "f2" (λ (editor evt) (send editor select-forward-sexp))) 
(keybinding "f3" (λ (editor evt) (send editor select-backward-sexp))) 

(keybinding "f8" (λ (editor evt) (send editor undo))) 
(keybinding "f7" (λ (editor evt) (send editor redo))) 
(keybinding "f10" (λ (editor evt) (send editor cut))) 
(keybinding "f11" (λ (editor evt) (send editor copy))) 
(keybinding "f12" (λ (editor evt) (send editor paste))) 

and then did the Add User-defined Keybindings... menu item in the
Keybindings sub-menu of Edit to add kbd-bind.rkt in. 

the box is lambda, just like in the one example.  It took me a while
to guess the names of the functions.  My first guess was that `cut'
was `cut-clipboard', and my next guess was `Cut', but `cut' turned out
to work.

The manual ought to say that you have to remove User-defined
Keybindings if they don't work, off the same submenu.


Posted on the users mailing list.