[plt-scheme] Keybinding question
Grant wrote:
> [Try] this code:
>
> (module dave-keys (lib "keybinding-lang.ss" "framework")
>
> (define (test editor event)
> (send (send editor get-keymap) call-function "collapse-space"
> editor event #t))
>
> (keybinding ":f2" test))
Robby wrote:
> Yes, unfotunately, DrScheme doesn't do a good job of removing and re-
> adding keybindings when you change the file. Best to just restart
> Drscheme. I've added a note about this to the docs.
Sorry for the late response, guys. Thanks very much for your help.
Grant's code works a treat.
FYI - I originally wanted to bind Alt-Space to collapse-space.
Ironically, I noticed after I made my post about this that Alt Space
is already the default binding for the command. The keystroke works
under Linux but in OS X it inserts a space instead.
Anyway, I'm okay now because I've adapted Grant's code to give me Ctrl
Space instead. Perhaps it's an oddity of OS X? Just thought I'd let
you know.
Cheers,
-- Dave