[plt-scheme] Swedish keyboard bug in DrScheme

From: Pekka Karjalainen (p3k at iki.fi)
Date: Fri Jun 13 12:33:43 EDT 2008

On 6/13/08, Niklas Larsson <nifty at live.se> wrote:
> In DrScheme 4.0 for Windows it is impossible to type a backslash character
> on a swedish keyboard. We use the AltGr-+ combination to get '\' on swedish
> keyboards, it does nothing in DrScheme, all other AltGr combinations seem to
> work fine (braces, @, $, €...). This problem didn't exist in v371. A really
> weird bug.

DrScheme has a default keybinding where Meta-\ means "TeX compress".
This changes the names of greek letters written in TeX style to the
corresponding symbols. E.g. \beta turns into the actual character for
lowercase beta. I think this only works when the caret is placed right
after such a string.

You can change the keybinding with the help of this piece of code.
It's based on a message I found in the mailing list archives, as
referenced. Save this as a file mykeys.ss somewhere convenient.

;; following the msg
(module mykeys (lib "keybinding-lang.ss" "framework")
  (define (make-handler s)
    (lambda (editor event)
      (send editor insert (make-object string-snip% s))))

  (keybinding "M:\\" (make-handler "\\")))

Then go to Edit -> Keybindings -> Add User-defined Keybindings and
choose the file you just saved. This should make the key combination
do what you expect. You can remove this file from use later; an option
to do this appears in the menu.

If the preferred form for the above in DrScheme 4.0 is something else,
I'd be happy to know about it. All I really know is that it works for
me, and I'll eventually get around to learning more about snips and

Pekka Karjalainen, with pretty much the same kind of keyboard

Posted on the users mailing list.