Does anyone has some thoughts about these issues? Or did I completely misunderstood how keybinding works?<br><br><div class="gmail_quote">On Wed, Nov 25, 2009 at 16:39, Laurent <span dir="ltr"><<a href="mailto:laurent.orseau@gmail.com">laurent.orseau@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi all,<br><br>DrScheme is a wonderful editor and the possibility to remap keys is great... when you can make it work.<br>
I'm struggling with my "mykeys.ss" and the net and the help desk could not help me much.<br>
There is of course the useful:<br><a href="http://schemekeys.blogspot.com/2007/05/keybinding-101-in-drscheme.html" target="_blank">http://schemekeys.blogspot.com/2007/05/keybinding-101-in-drscheme.html</a><br>but it says nothing about the hereby problems.<br>
I did not find anything about keybindings on planet (is there?).<br><br>First, in order to rebind some keys defined for menus, the option<font style="font-family: arial,helvetica,sans-serif;" size="2" face="Courier New"> "keybindings in
menus"</font><font size="2"> in menu
preferences/editing/general</font> must be disabled (for me, and it seems that this behavior is different for other people (?)).<br>My quick guess is that the menus keybindings are defined after "mykeys.ss" file is loaded, which is not what I want.<br>
This forces me to redefine some of the bindings of the menus by hand...<br><br>Thus, Second: How do I rebind a key to open a new tab?<br>Let's define (this is a untested simplification of my file):<br>
<blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">(define (keymap-fun fun-name)<br>
(lambda (editor event) <br>
(send (send editor get-keymap) call-function<br>
fun-name<br>
editor event #t)))<br>
</blockquote>
Then:<br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">(keybinding "c:n" (keymap-fun "New Tab"))<br></blockquote>does not work (it does nothing, no error, not even printing "n").<br>
"New tab", "Nouvel onglet", "Nouvel Onglet" (my DrScheme is in french, so I don't know which is the good one) did not work either.<br>Where can I find information about this? (because there are other menu items that I want to rebind)<br>
<br>Third:<br>I tried some experiments and there are some strange behaviors:<br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">(for-each (lambda (key-str) (keybinding (first key-str) (keymap-fun (second key-str))))<br>
'(<br> ["c:semicolon" "comment-out"] ; works<br> ["c:s:semicolon" "uncomment"] ; does not work (on french layout, "." is ";" shifted)<br> ["c:s:." "uncomment"] ; does not work (also c:s:period does not exist)<br>
["c:." "uncomment"] ; does not work<br> ["c:s:q" "uncomment"] ; does not work, prints "Q"<br> ["c:q" "uncomment"] ; works<br> ["c:s:W" "uncomment"] ; does not work, prints "W"<br>
["c:W" "uncomment"] ; works, like c:w<br> ["c:m:r" "uncomment"] ; does not work, does nothing<br> ["m:s:r" "uncomment"] ; works<br> ["m:semicolon" "uncomment"] ; works<br>
["m:s:semicolon" "uncomment"] ; does not work, prints "."<br> ))<br></blockquote><br>I would especially like the "c:s:semicolon" to work...<br><br>Also, reloading DrScheme for each test takes some time... isn't there a faster way to test keybindings?<br>
<br>Thanks for reading this and helping me if possible.<br><font color="#888888"><br>Laurent<br>Using DrScheme 4.2.2 french and (unfortunately) Vista SP1<br>
</font></blockquote></div><br>