Remapping the cursor keys in MSKLC?

by Michael S. Kaplan, published on 2006/09/18 10:01 -04:00, original URI: http://blogs.msdn.com/b/michkap/archive/2006/09/18/760153.aspx


Maxwell asks:

For years now, I have used a program (originally based on someone else's, but with very little of their code any more) to remap the control keys to cursor keys: ^K is the up arrow, ^H is the left arrow, etc., and ^Q sets a toggle so that ^K is shift-up arrow, etc. (until it gets another ^Q, or ^C or etc.). There's lots of other nasty stuff, like the first ^A is Home, a second ^A (with no intervening keystrokes) brings you to the top of the screen, and a third to the top of the file (this is modeled after what <HOME> did in the old 'brief' editor). My fingers know all these things, and it's painful if I have to do without this remapper.

This program operates by hooking the keyboard msgs using SetWindowsHookEx(WH_KEYBOARD, ...), then translating the control keys. For various reasons, it would be better if it were a standard Keyboard Layout. But I don't know how to build one of those from scratch. I was hoping your Ms Keyboard Layout Creator would let me do that, but so far as I can tell it only allows you to define keys as outputting Unicode characters. Very nice, but not what I want...

I don't suppose that modifying the Layout Creator to allow one to specify e.g. VK_DOWN in the output is going to happen any time soon, right? If not, can you point me to a better way to do what I'm doing than hooking the keyboard msgs? Thanks!

There isn't a happy answer to this question -- it is roughly the same as the answer to the question answered in the post Why doesn't MSKLC have a numeric keypad?

And the reasoning is roughly the same -- that this is not really a language feature. So it really was not in the mandate that put together MSKLC.

Certainly this is a scenario which (like the numeric keypad) can perhaps be considered in some future release. Though it may be a hard sell for all of the reasons given in that other post.

I don't know of specific better soloutions myself, but people have talked about key mappers in the past. Perhaps someone has a suggestion?

 

This post brought to you by (U+21d1, a.k.a. UPWARDS DOUBLE ARROW)


no comments

Please consider a donation to keep this archive running, maintained and free of advertising.
Donate €20 or more to receive an offline copy of the whole archive including all images.

referenced by

2008/08/01 How do you key your num pad without going blind?

2006/09/20 Variation on that theme of wanting more keys covered by MSKLC

go to newer or older post, or back to index or month or day