[plt-scheme] getting to grips with keymaps

From: Martin DeMello (martindemello at gmail.com)
Date: Sat Jul 26 23:51:39 EDT 2008

I've reached the point where I need to add keymaps to my text editor,
and I'm having trouble knowing where to start. (I tried reading
through the drscheme sources, but that's a lot to bite off at once,
and the documentation is more reference than tutorial). Specifically,
I have a list of editable-text% objects (editable-text% subclasses
text%) and a list of editor-snip% objects, each holding an
editable-text%.

Where in all that would I add a keymap, and how? Also, my
editable-text% class has the following chunk of code:

    (define/override (on-local-char key)
      (let ([code (send key get-key-code)])
        (cond [(and (equal? code 'down) (last-line?)) (next-editor) ]
              [(and (equal? code 'up) (first-line?)) (prev-editor) ]
              [else (super on-local-char key)])))

would I need to remove that and integrate it with the keymap instead?

martin


Posted on the users mailing list.