Not only going BACK, but changing how to do it

by Michael S. Kaplan, published on 2008/10/27 08:21 -04:00, original URI: http://blogs.msdn.com/b/michkap/archive/2008/10/27/9018025.aspx


Late last week, Jan Kučera asked over in the Suggestion Box (which I am thinking of renaming to Jan's Place, soon!):

Hello.. I have a short one today: Could I use the MSKLC to make for example the B key to act as backspace key (and if so, how :))?

Thanks!

Very good question.

The quickest answer is just two letters and a punctuatuon mark:

No.

The slightly longer answer is:

No, MSKLC cannot be used to muck with the backspace.

But this answer, while technically true, has me making an assumption that most people wouldn't make.

I am treating MSKLC as meaning msklc.exe, rather than the full Microsoft Keyboard Layout Creator installation, while most people would actually assume the latter and not the former.

Because just as with other blogs that talk aboput the .KLC file and KBUTOOL.EXE, like Pimping your Brazilian keyboard and In case you have a yen to extend your keyboard (or at least want a yen?) and so forth, there is a way to muck around here some....

You see, there are certain defaiult entries that evry keyboard has, and KBDUTOOL.EXE automatically adds them at build time if they are not already specified in the .KLC file.

Which means that you could specify them!

Some of those entries (with their default values on a US keyboard) are:

0e   VK_BACK   0      0008     0008
01   VK_ESCAPE 0      001b     001b
0d   VK_RETURN 0      000d     000d
53   VK_CANCEL 0      0003     0003
0f   TAB       0      0009     0009

and of course you would need to change the scan code in front of each one you wanted to change (like in Jan's case, taking the scan code off the "B" and using that value should do the trick!).

Make sure to remove any duplicate entries in your own file....

Now one warning -- since these values tend to never change, the fact that you are changing them may fail in some applications that were assuming they would never change. Whether this is their bug or yours is an interesting philosophical issue but I'm sure you can imagine that you will be at a disadvantage when you argue the point with them.

The moral of the story of the whole blog is that sometimes it is worth waiting for the longer answer. :-)

 

This blog brought to you by U+0008, aka BACKSPACE


Jan Kučera on 27 Oct 2008 9:59 AM:

Hmm...feel quite embarrased now, maybe I should stop promoting the suggestion box for a while... :)

Here is what led me to this question:

Imagine I have a key, which is mapped to type "KA". Now I would like to have kind of modifier O key, so pressing my "KA" key followed by O (and not vice versa) would turn into "KO" typed. So the first - and probably quite stupid - idea was that the O modifier key could consist of "<BACKSPACE>O"...

I've tried to set-up this in MSKLC and it works in notepad, though not in Word :( where I need it at most.

I actually treated MSKLC as meaning msklc.exe while stating the question, but I'm glad I have waited for the longer answer! Though the quick one is what probably covers my original idea...

Thanks for the insight into possibilities of MSKLC in the other meaning!

Jan

Øystein Bech Gadmar on 16 Nov 2008 4:15 AM:

Interesting!

So if one wants to, say, turn the CapsLock key into a Backspace *innocent yet somehow slightly nervous smile*, would this line somewhere in the main part of the .klc file do the trick?

3a VK_BACK 0 0008 0008

Could you give a link to a full list of the entries, please? This seems like a most useful trick.

Would the failure in some applications be due to those applications not using the virtual key but the scancode directly?

Michael S. Kaplan on 16 Nov 2008 10:13 AM:

I am specifically *not* a supporter of the COLEMAK keyboard layout. Thanks for trying though! :-)

&#216;ystein Bech Gadmar on 20 Nov 2008 5:32 AM:

Ah. Sorry if my jest was taken as hidden aggression or anything. It was meant to ease tension, not promote it. I specifically did not intend to promote or proselytize anything and I'm sorry if I gave an impression to that effect.

Ignoring the hopefully irrelevant point of how my letter keys may happen to be organized (and certainly not trying to stir up anything at all!), please wipe the slate clean and reconsider the question:

The possibility for support of these additional keys by the MSKLC.exe is intrigueing. Hobby remappers such as myself could for instance put an extra Enter key in a more reachable position (one favourite of mine is to make a pseudo-ergonomic board by shifting ZXCVB and VK_102; the old B position could become an Enter key for instance) or a second AltGr-key that the left hand could reach - is that so?

I'd need to add a line to the .klc file as exemplified above, and then compile - right? I'm still a bit fuzzy on whether the MSKLC 1.4 itself could compile such a .klc file correctly or whether I'd need to run the kbdutool.exe from the command line (and which switches I'd need to use then) - sorry if I'm being dense.

Yeah, and the two last questions of my previous post. Pretty please.

This supplication brought to you by U+00D8, AKA Scandinavian letter Ø

Qwertyist on 11 Dec 2008 9:20 AM:

Hmmm ...

Alexander Knopf on 21 Oct 2009 2:40 PM:

still under a year since the post, i should be good ....

i have a (very special) keyboard layout that is actually optimized for programmers. it uses 3 levels just like the standard german keyboard layout does. however, it makes very heavy use of the 3rd level (the german one only uses it on the number keys and very few others).

i have brackets on the home row, the questionmark as well.... either way, not the point.

the point is that the caps lock key functions as AltGr key, but i still want a caps lock key. there is a second AltGr key right next to the enter key, which would turn on caps lock if pressed at the same time as the other one.

is that possible with kbdutool ?

Michael S. Kaplan on 21 Oct 2009 9:15 PM:

No, this won't work with msklc or kbdutool....


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.

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