[plt-scheme] keybinding and menus
2009/12/2 Laurent <laurent.orseau at gmail.com>:
>
>> #lang s-exp framework/keybinding-lang
>>
>> (define (get-frame obj)
>> (cond
>> [(is-a? obj editor<%>)
>> (send (send obj get-canvas) get-top-level-window)]
>> [else
>> (send obj get-top-level-window)]))
>>
>> (keybinding "c:n" (λ (obj evt) (send (get-frame obj) open-in-new-tab #f)))
>
> that works! :)
>
> For other people who might be interested in this, here are some others (on a frame%):
> (close-current-tab)
> (on-tab-change from-tab to-tab)
> (enable-evaluation)
> (disable-evaluation)
Probably you don't want to use enable-evaluation or disable-evaluation
from a keybinding. Those are for disabling the GUI so the program is
not changed while it is begin evaluated or syntax check'd.
> (in PLT\collects\drscheme\private\unit.ss)
> I guess the `on-tab-change' could be used to implement more flexible tab switching.
>
>>
>> > I would especially like the "c:s:semicolon" to work...
>>
>> I think you might just need the ?: prefix to make things work (see the
>> docs for map-function for more on that). This is a messy area that
>> needs to be cleaned up at some point, but one of the above should be
>> made to work. I don't have a windows machine (or a french keyboard!)
>> to try these things out so I'm kind of stuck on this one.
>
> Well, there remains a weird behavior:
> the "?:c:s:semicolon" works fine in a little editor (see the bottom of this email),
> but when I use it in "mykeys.ss" for DrScheme, it does not work!
>
> Same for (the 3 symbols are on the same key on a french layout):
> ["$" ,(insert-string "$$$")]
> ["?:s:$" ,(insert-string "£££")]
> ["?:c:m:$" ,(insert-string "¤¤¤")]
>
> These work in the little editor below, but not in DrScheme.
> I suspect this is the same for many particular keys.
> I don't know if this behavior is particular to french keyboard or to foreign ones, or if this occurs also on english keyboards (I guess not (?)).
>
> I'm using DrScheme 4.2.3, not the SVN one, maybe this is also because of the menus (whose shortcuts I have disabled)?
I don't think it is because of the menus. It is something to do with
the way drscheme has set up its keymaps, probably, but I'm at a loss
for how to try to debug this (without getting a french version windows
and a french keyboard).
Robby