[racket] Need Help With Keybindings

From: David G. Kay (dgkdgk at gmail.com)
Date: Sat Sep 10 15:56:29 EDT 2011

Hi, everyone;

I'd like to rebind some of the DrRacket
editor keys.  (I'm trying to reproduce the
idiosyncratic editor layout I'm used to;
it has an emacs flavor but with different

To start, I just want to map ^t to move
up a line, ^v to move down, ^f to move
left, and ^g to move right.

I created this file ("keys.rkt"):

#lang s-exp framework/keybinding-lang

(keybinding "c:t" (lambda (editor evt) (send editor previous-line)))
(keybinding "c:v" (lambda (editor evt) (send editor next-line)))
(keybinding "c:f" (lambda (editor evt) (send editor backward-character)))
(keybinding "c:g" (lambda (editor evt) (send editor forward-character)))

I add the file using "Add User-defined
Keybindings" in DrRacket.  But I get
this message as soon as I type one of
my rebound keys:

Error running keybinding .../Scheme/keys.rkt:18:18

send: no such method: previous-line for class: ...engine/test-tool.scm:36:6

It's complaining about the previous-line
method, but that's listed in section 7
(Editor Functions) of the Racket Graphical
Interface Toolkit manual:

I'm running Racket 5.1.3 on a two-year-old
MacBook Pro under OS X 10.7 Lion.

I'd be grateful for any assistance.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20110910/fb2616e7/attachment.html>

Posted on the users mailing list.