[racket] separate keybindings for interaction vs. definition window

From: Benjamin Rahn (benjamin.rahn at gmail.com)
Date: Fri Jan 14 00:43:17 EST 2011

I'm creating some custom key bindings.  Is there a way to make the key  
bindings different for the interaction frame vs. the definitions window?

Specifics: I would like to use the up/down keys (with no modifiers) to  
move back and forth through expressions that have been previously  
entered into the interaction window.  I have a custom keybindings file  
(below) does this.

However, it simultaneously disables the up/down arrows in the  
definitions window, which is of course a deal-breaker.

Is there a way I can use these keybindings in the interaction window,  
but leave the definitions window behavior unchanged?

Thanks!

-Ben



***********

#lang s-exp framework/keybinding-lang

; I'm sure there's a less verbose way to achieve the same results,  
comments welcome.

(keybinding ":down" (lambda (editor event)
   (send
     (send editor get-keymap)
     call-function
     "put-next-sexp"
     editor event #t)))

(keybinding ":up" (lambda (editor event)
   (send
     (send editor get-keymap)
     call-function
     "put-previous-sexp"
     editor event #t)))



Posted on the users mailing list.