[racket] Conflict between framework/keybinding-lang and existing keybindings

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Thu Nov 18 06:20:23 EST 2010

I think that this might be a bug in the keymap library. In particular,
in the code below (assuming I didn't do something wrong), I'd expect
c:x;h and c:x;i to both work, but only c:x;i does.

#lang racket/gui
(define k (new keymap%))
(define k2 (new keymap%))
(define k3 (new keymap%))
(send k chain-to-keymap k2 #t)
(send k chain-to-keymap k3 #t)

(send k2 add-function "h" (λ args (printf "h\n")))
(send k3 add-function "i" (λ args (printf "i\n")))
(send k2 map-function "c:x;h" "h")
(send k3 map-function "c:x;i" "i")

(define t (new text%))
(send t set-keymap k3)
(define f (new frame% [label ""] [width 200] [height 200]))
(define ec (new editor-canvas% [parent f] [editor t]))
(send ec focus)
(send f show #t)


On Wed, Nov 17, 2010 at 7:57 AM, Eduardo Bellani <ebellani at gmail.com> wrote:
> Hello
> I've found that if you use c:x;ANYTHING inside a
> #lang s-exp framework/keybinding-lang file for a user defined
> keybindings, you end up disabling all the other c:x;SOMETHING keybindings.
> For example:
> (keybinding "c:x;h"
>            (λ (editor evt) (send editor insert "hello")))
> Then try anything with a c:x as a prefix.
> I'm using version 5.0.1 in ubuntu 9.10
> Any suggestions?
> --
> Eduardo Bellani
> omnia mutantur, nihil interit.
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users

Posted on the users mailing list.