[plt-scheme] vi mode and editor questions

From: Jon Rafkind (workmin at ccs.neu.edu)
Date: Sat Nov 22 17:32:05 EST 2008

Robby Findler wrote:
> On Sat, Nov 22, 2008 at 4:04 PM, Jon Rafkind <workmin at ccs.neu.edu> wrote:
>   
>>>> 2. I would like to capture the control key for ctrl-d and whatnot but
>>>> most
>>>> ctrl-# key bindings do something in drscheme and when ctrl-# keys that
>>>> aren't bound in drscheme don't seem to make their way to my editor.
>>>>
>>>>         
>>> You should be able to catch them in on-char, if not on-default-char.
>>>
>>>
>>>       
>> That doesn't seem to be the case. I am on Ubuntu.
>> (define/override (on-char evt)
>>          (printf "Control ~a char ~a\n" (send evt get-control-down)
>>                  (send evt get-key-code)))
>>
>> If I press the control key I see
>>
>> Control #f char control
>>
>> Then with
>> (define/override (on-default-char evt)
>>          (send (car modes) do-char evt))
>>
>> Where do-char does the same printing as on-char I don't get any control key
>> events. Further more if I press ctrl-s the save box comes up but for vi mode
>> I would like to disable things like this.
>>     
>
> I'm sorry -- that sounds like you do get the key events in on-char
> (and not in on-default-char). What did you want to happen?
>
>   
Oh yea, sorry. So when I press control I get an event that has the key 
code as 'control'. But shouldn't the get-control-down be #t in this 
case? What I want is to be able to press ctrl-d and have 
(get-control-down) be #t and (get-key-code) be #\d.


Posted on the users mailing list.