[plt-scheme] Help with User keybinding needed.

From: Danny Yoo (dyoo at hkn.eecs.berkeley.edu)
Date: Fri Mar 31 16:05:55 EST 2006

On Fri, 31 Mar 2006 kazimir at chem.pmf.hr wrote:

> My PLT does not recognize < > from Croatian keyboard. I know that this
> can be solved with keybinding, but advices in manual are over my head
> now. How the file that adds following keybidnigns should look like?
> AltGr+;  to   <
> AltGr+:  to   >

Hi Kazimir,

I'm not sure what the 'AltGr' modifier is; do you mean the Alt or Meta

Let me see... Ok, got it.  I'm also not sure if this is the best way to do
this either, but here's an example that binds M-, to the less than sign,
and M-. to the greater than sign:

(module test-keybindings (lib "keybinding-lang.ss" "framework")
  ;; A small demo of how we can make our own keymap handlers

  ;; make-handler: string -> handler
  ;; makes a handler that inserts the string s
  (define (make-handler s)
    (lambda (editor event)
      (send editor insert (make-object string-snip% s))))

  ;; Some sample bindings:
  (keybinding "M:," (make-handler "<"))
  (keybinding "M:." (make-handler ">")))

I hope this helps!

Posted on the users mailing list.