Ctrl doesn't work in MacVim (Snow Leopard) with a Swedish Dvorak keyboard layout (linked)...

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Ctrl doesn't work in MacVim (Snow Leopard) with a Swedish Dvorak keyboard layout (linked)...

Fredrik Bränström

Was wondering if anybody could help me solve this. The other layouts
work just fine, but in MacVim, the ctrl key is dead. Ctrl+R just
outputs an R to vim, for example.

Here's the layout in question: http://aoeu.info/layouts/files/SvorakA5-OSX.zip
( http://aoeu.info/s/dvorak/images/svorak-A5.png )

Granted, this is a bit of a special case. The .keylayout file is
probably to blame. But is there something wrong with the definition of
the modifier key in the layout, or what?

Tomorrow I'm going to try to look around inside the files and compare
them to see if anything looks fishy.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Ctrl doesn't work in MacVim (Snow Leopard) with a Swedish Dvorak keyboard layout (linked)...

Björn Winckler

2009/9/10 Fredrik Bränström:

>
> Was wondering if anybody could help me solve this. The other layouts
> work just fine, but in MacVim, the ctrl key is dead. Ctrl+R just
> outputs an R to vim, for example.
>
> Here's the layout in question: http://aoeu.info/layouts/files/SvorakA5-OSX.zip
> ( http://aoeu.info/s/dvorak/images/svorak-A5.png )
>
> Granted, this is a bit of a special case. The .keylayout file is
> probably to blame. But is there something wrong with the definition of
> the modifier key in the layout, or what?
>
> Tomorrow I'm going to try to look around inside the files and compare
> them to see if anything looks fishy.

Hi Fredrik,

I can take a look at this but first I'd like to know what that
installer does?  Isn't there a simple .keyboardlaout file or something
that I can install manually in "~/Library/Keyboard Layouts"?

Björn

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Ctrl doesn't work in MacVim (Snow Leopard) with a Swedish Dvorak keyboard layout (linked)...

Fredrik Bränström
Sure, attaching the .keylayout file

Fredrik Bränström
http://branstrom.name


On Sat, Sep 12, 2009 at 21:53, björn <[hidden email]> wrote:

2009/9/10 Fredrik Bränström:
>
> Was wondering if anybody could help me solve this. The other layouts
> work just fine, but in MacVim, the ctrl key is dead. Ctrl+R just
> outputs an R to vim, for example.
>
> Here's the layout in question: http://aoeu.info/layouts/files/SvorakA5-OSX.zip
> ( http://aoeu.info/s/dvorak/images/svorak-A5.png )
>
> Granted, this is a bit of a special case. The .keylayout file is
> probably to blame. But is there something wrong with the definition of
> the modifier key in the layout, or what?
>
> Tomorrow I'm going to try to look around inside the files and compare
> them to see if anything looks fishy.

Hi Fredrik,

I can take a look at this but first I'd like to know what that
installer does?  Isn't there a simple .keyboardlaout file or something
that I can install manually in "~/Library/Keyboard Layouts"?

Björn




--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---


SvorakA5.keylayout (33K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Ctrl doesn't work in MacVim (Snow Leopard) with a Swedish Dvorak keyboard layout (linked)...

Fredrik Bränström
Uh, wrong file. The .keylayout is located in the .bundle/Contents/Resources... Attaching the .bundle.

Fredrik Bränström
http://branstrom.name


2009/9/12 Fredrik Bränström <[hidden email]>
Sure, attaching the .keylayout file

Fredrik Bränström
http://branstrom.name



On Sat, Sep 12, 2009 at 21:53, björn <[hidden email]> wrote:

2009/9/10 Fredrik Bränström:
>
> Was wondering if anybody could help me solve this. The other layouts
> work just fine, but in MacVim, the ctrl key is dead. Ctrl+R just
> outputs an R to vim, for example.
>
> Here's the layout in question: http://aoeu.info/layouts/files/SvorakA5-OSX.zip
> ( http://aoeu.info/s/dvorak/images/svorak-A5.png )
>
> Granted, this is a bit of a special case. The .keylayout file is
> probably to blame. But is there something wrong with the definition of
> the modifier key in the layout, or what?
>
> Tomorrow I'm going to try to look around inside the files and compare
> them to see if anything looks fishy.

Hi Fredrik,

I can take a look at this but first I'd like to know what that
installer does?  Isn't there a simple .keyboardlaout file or something
that I can install manually in "~/Library/Keyboard Layouts"?

Björn





--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---


SvorakA5.bundle.zip (1M) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Ctrl doesn't work in MacVim (Snow Leopard) with a Swedish Dvorak keyboard layout (linked)...

Björn Winckler

2009/9/12 Fredrik Bränström <[hidden email]>:
> Uh, wrong file. The .keylayout is located in the
> .bundle/Contents/Resources... Attaching the .bundle.

Thanks, that worked.

Now, there is something wrong with your keylayout file which can be
checked by entering Ctrl-h in TextEdit -- this should act as back
space but it just inserts "h" instead.  Same thing obviously happens
in MacVim.

I can't tell you exactly what is wrong with your keylayout file
however since I'm not at all familiar with them.  What I can tell you
is that pressing Ctrl-h on a US layout will generate a different key
code than your layout does, so it seems that it is sending the wrong
keycode (is this something you can specify?).

This is the event that comes from pressing Ctrl-h with your layout:

NSEvent: type=KeyDown loc=(0,753) time=20068.1 flags=0x40001 win=0x0
winNum=124 ctxt=0xc997 chars="^H" unmodchars="h" repeat=0 keyCode=38

...and this is from Ctrl-h on a US layout:

NSEvent: type=KeyDown loc=(0,753) time=20130.1 flags=0x40101 win=0x0
winNum=124 ctxt=0xc997 chars="^H" unmodchars="h" repeat=0 keyCode=4

As you can see they are fairly similar but the key code is different
(and the flags, but that is in the lower 16 bits and has nothing to do
with modifier keys).

Anyway, hopefully you can figure out what the problem is...let me know
how it goes.

Björn

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Ctrl doesn't work in MacVim (Snow Leopard) with a Swedish Dvorak keyboard layout (linked)...

Axel Kielhorn
In reply to this post by Fredrik Bränström


Am 12.09.2009 um 22:06 schrieb Fredrik Bränström:

> Uh, wrong file. The .keylayout is located in the .bundle/Contents/
> Resources... Attaching the .bundle.

I had a look at your keylayout file:

There is no mapping table for control. My custom map file has:

     <modifierMap id="commonModifiers" defaultIndex="0">
         <keyMapSelect mapIndex="0">
             <modifier keys=""/>
             <modifier keys="command anyShift? caps?"/>
         </keyMapSelect>
         <keyMapSelect mapIndex="1">
             <modifier keys="anyShift caps?"/>
         </keyMapSelect>
         <keyMapSelect mapIndex="2">
             <modifier keys="caps"/>
         </keyMapSelect>
         <keyMapSelect mapIndex="3">
             <modifier keys="anyOption"/>
         </keyMapSelect>
         <keyMapSelect mapIndex="4">
             <modifier keys="anyShift caps? anyOption"/>
         </keyMapSelect>
         <keyMapSelect mapIndex="5">
             <modifier keys="anyShift? caps? anyOption command"/>
         </keyMapSelect>
         <keyMapSelect mapIndex="6">
             <modifier keys="anyShift? caps? anyOption? command?  
anyControl"/>
         </keyMapSelect>
     </modifierMap>

While you only have

        <modifierMap id="48" defaultIndex="0">
                <keyMapSelect mapIndex="0">
                        <modifier keys="" />
                </keyMapSelect>
                <keyMapSelect mapIndex="1">
                        <modifier keys="anyShift" />
                        <modifier keys="caps" />
                </keyMapSelect>
                <keyMapSelect mapIndex="2">
                        <modifier keys="anyOption caps?" />
                </keyMapSelect>
                <keyMapSelect mapIndex="3">
                        <modifier keys="command anyShift? caps? anyControl?" />
                </keyMapSelect>
                <keyMapSelect mapIndex="4">
                        <modifier keys="command anyShift? caps? anyOption anyControl?" />
                </keyMapSelect>
        </modifierMap>

My keymap 6 looks like this:
(Warning, this will give you a german keylayout for control if you  
insert it into your keylayout.)

         <keyMap index="6">
             <!-- control -->
             <key code="0" output="&#x0001;"/>
             <key code="1" output="&#x0013;"/>
             <key code="2" output="&#x0004;"/>
             <key code="3" output="&#x0006;"/>
             <key code="4" output="&#x0008;"/>
             <key code="5" output="&#x0007;"/>
             <key code="6" output="&#x001a;"/>
             <key code="7" output="&#x0018;"/>
             <key code="8" output="&#x0003;"/>
             <key code="9" output="&#x0016;"/>
             <key code="10" output="0"/>
             <key code="11" output="&#x0002;"/>
             <key code="12" output="&#x0011;"/>
             <key code="13" output="&#x0017;"/>
             <key code="14" output="&#x0005;"/>
             <key code="15" output="&#x0012;"/>
             <key code="16" output="&#x0019;"/>
             <key code="17" output="&#x0014;"/>
             <key code="18" output="1"/>
             <key code="19" output="2"/>
             <key code="20" output="3"/>
             <key code="21" output="4"/>
             <key code="22" output="6"/>
             <key code="23" output="5"/>
             <key code="24" output="="/>
             <key code="25" output="9"/>
             <key code="26" output="7"/>
             <key code="27" output="&#x001f;"/>
             <key code="28" output="8"/>
             <key code="29" output="0"/>
             <key code="30" output="&#x001d;"/>
             <key code="31" output="&#x000f;"/>
             <key code="32" output="&#x0015;"/>
             <key code="33" output="&#x001b;"/>
             <key code="34" output="&#x0009;"/>
             <key code="35" output="&#x0010;"/>
             <key code="36" output="&#x000d;"/>
             <key code="37" output="&#x000c;"/>
             <key code="38" output="&#x000a;"/>
             <key code="39" output="'"/>
             <key code="40" output="&#x000b;"/>
             <key code="41" output=";"/>
             <key code="42" output="&#x001c;"/>
             <key code="43" output=","/>
             <key code="44" output="/"/>
             <key code="45" output="&#x000e;"/>
             <key code="46" output="&#x000d;"/>
             <key code="47" output="."/>
             <key code="48" output="&#x0009;"/>
             <key code="49" output=" "/>
             <key code="50" output="`"/>
             <key code="51" output="&#x0008;"/>
             <key code="52" output="&#x0003;"/>
             <key code="53" output="&#x001b;"/>
             <!-- gap, 54 through 64 -->
             <key code="64" output="&#x0010;"/>
             <key code="65" output="."/>
             <key code="66" output="&#x001d;"/>
             <key code="67" output="*"/>
             <!-- gap, 68 -->
             <key code="69" output="+"/>
             <key code="70" output="&#x001c;"/>
             <key code="71" output="&#x001b;"/>
             <key code="72" output="&#x001f;"/>
             <!-- gap, 73-74 -->
             <key code="75" output="/"/>
             <key code="76" output="&#x0003;"/>
             <key code="77" output="&#x001e;"/>
             <key code="78" output="-"/>
             <!-- gap, 79-80 -->
             <key code="79" output="&#x0010;"/>
             <key code="80" output="&#x0010;"/>
             <key code="81" output="="/>
             <key code="82" output="0"/>
             <key code="83" output="1"/>
             <key code="84" output="2"/>
             <key code="85" output="3"/>
             <key code="86" output="4"/>
             <key code="87" output="5"/>
             <key code="88" output="6"/>
             <key code="89" output="7"/>
             <!-- gap, 90 -->
             <key code="91" output="8"/>
             <key code="92" output="9"/>
             <!-- gap, 93-95 -->
             <key code="96" output="&#x0010;"/>
             <key code="97" output="&#x0010;"/>
             <key code="98" output="&#x0010;"/>
             <key code="99" output="&#x0010;"/>
             <key code="100" output="&#x0010;"/>
             <key code="101" output="&#x0010;"/>
             <key code="102" output="&#x0010;"/>
             <key code="103" output="&#x0010;"/>
             <key code="104" output="&#x0010;"/>
             <key code="105" output="&#x0010;"/>
             <key code="106" output="&#x0010;"/>
             <key code="107" output="&#x0010;"/>
             <key code="108" output="&#x0010;"/>
             <key code="109" output="&#x0010;"/>
             <key code="110" output="&#x0010;"/>
             <key code="111" output="&#x0010;"/>
             <key code="112" output="&#x0010;"/>
             <key code="113" output="&#x0010;"/>
             <key code="114" output="&#x0005;"/>
             <key code="115" output="&#x0001;"/>
             <key code="116" output="&#x000b;"/>
             <key code="117" output="&#x007f;"/>
             <key code="118" output="&#x0010;"/>
             <key code="119" output="&#x0004;"/>
             <key code="120" output="&#x0010;"/>
             <key code="121" output="&#x000c;"/>
             <key code="122" output="&#x0010;"/>
             <key code="123" output="&#x001c;"/>
             <key code="124" output="&#x001d;"/>
             <key code="125" output="&#x001f;"/>
             <key code="126" output="&#x001e;"/>
             <!-- gap, 127 -->

You can modify your keylayout using ukeklele.
http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=ukelele


Axel


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---