1

Re: Remapping CapsLock?

I have tried ViEmu several times. I will be registering very soon  smile

I was wondering if it was possible to use :map/:noremap to map the CapsLock key to the Esc key. Maybe it's in the documentation, but I couldn't find it. I've seen lots on the Vim forums about remapping via registry edits, but it seems like a pain. Any thoughts?

2

Re: Remapping CapsLock?

Hmm, there is no support for capslock via :map. Caps lock it's a pretty irregular key and it doesn't fit in ViEmu's mapping scheme. So there is no other way to map it than hacking the registry or keyboard layout... it's certainly a system-level thing.

I followed the instructions in the following page (Windows XP SP2), and it was working in the time it took to reboot:

  http://vim.sourceforge.net/tips/tip.php?tip_id=75

It works both in gvim and in ViEmu, and I guess that system-wide.

Best regards,

  Jon

3

Re: Remapping CapsLock?

Thanks Jon for the answer and swheatley for the idea! I just tried the link Jon sent, with a small modification to swap both keys (not only assign the ESC key to the CAPSLOCK, but to asssing the CAPSLOCK to the ESC key):

REGEDIT4
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,03,00,00,00,01,00,3a,00,3a,00,01,00,00,00,00,00

I don't know if it's really needed, but it doesn't make any harm to swap both keys (so you don't loose the CAPSLOCK key). May be the original code is enough, have any of you try it out?

Thanks again,

Nando

4

Re: Remapping CapsLock?

Nando, I have now caps lock remapped to esc. I used to use Ctrl-[ for some time, but I think I've lost the custom. I'll see whether the capslock trick sticks! If so, I'll have to do it in all computers I use.

And I don't really miss the capslock functionality, I never use it - but thanks for posting the version - I wouldn't even know what bytes to start modifying!

5

Re: Remapping CapsLock?

This URL helps to understand the syntax of the batch file:

http://www.microsoft.com/whdc/device/input/w2kscan-map.mspx

6

Re: Remapping CapsLock?

Thanks! Saved to my del.icio.us list!

7

Re: Remapping CapsLock?

I installed AutoHotKey instead of hacking the registry and I've been very happy with the results. I'm sure I could do some other cool stuff with it too, but for now the caps lock->esc mapping is enough for me.

http://www.autohotkey.com/

8

Re: Remapping CapsLock?

Cool, thanks for the pointer. I will have a look at it.

Best regards,

  Jon