Why Michael's cool keyboard doesn't work

by Michael S. Kaplan, published on 2006/10/05 00:11 -07:00, original URI: http://blogs.msdn.com/michkap/archive/2006/10/05/792859.aspx

The question Abdul asked me (via the Contact link) was:

Sir, I installed msklc after severe frustration as you know it requires v1.1 of .net, even if v2.0 is installed. I knew this after much time.

Now I created the first ever keyboard for Siraiki language (spoken by 14m people in pakistan, which is part of Unicode v5.0). But when i build the dll and setup package, it builds the dll but not the windows installer package, saying "keyboard layout creator was unable to create the windows installer package".

I searched the net for help regarding this error message, but in vain. I hope you are the only person who can help.

Thanks in anticipation of reply!

First let me apologize about that 1.1/2.0 thing, I can promise you that it is high on the list of things I am nagging people about these days (my very next opportunity to do so is mere hours away!).

Now there are very few things that can cause the attempt to build the setup package to fail (all it is doing is running a series of queries to insert the needed rows into the .MSI file). In fact, assuming you are not trying to build the file into a read-only location and without seeing the MSKLC file (and trying to channel some of Raymond's powers of psychic debugging!), the only thing I can think of would be a string be added from this dialog:


that contains a ' (U+0027, a.k.a. APOSTROPHE) and thus when the attempt was made to insert the row into the Windows Installer database file (the .MSI file), the insert that unfortunately did not properly escape the character failed and returned this error:

A better error message would be nice here, of course.

Better validation that warned of the actual problem would be even nicer.

And proper escaping of these characters to let the insert succeed and the layout build would be the nicest thing that could happen....

Anyway, assuming this is the problem, sorry about this one too. If this isn't it, I need to know a bit more about this keyboard, and possibly get a copy of the .KLC file (let me know if your trouble is not being caused by the above)....

(Credit also to Erich Barnstedt in Ireland, who separately reported the same problem in the not too distant past and reactivated the bug report that had been closed after this bug had been fixed a long time ago but apparently regressed! However, Abdul's scenario of a Seraiki (a.k.a. Siraiki) keyboard is a much more interesting one to me!)


This post brought to you by ' (U+0027, a.k.a. APOSTROPHE)

# Heath Stewart on Thursday, October 05, 2006 11:40 AM:

You'll have a problem if you're using MsiDatabaseOpenView to pass in the SQL-like expressions: you can't escape single quotes. Instead, you have to select or (or a single, depending on what you do next) records from the table using MsiDatabaseOpenView, then construct a record using MsiCreateRecord with the right number of fields - including your text with the single quote - then use MsiViewModify to "set" the record in your view.

# Michael S. Kaplan on Thursday, October 05, 2006 1:13 PM:

Believe it or not, the MsiCreateRecord route is mostly what we use now, for unrelated reasons. I think these ones were just missed?

And, since we fixed the problem at one point, some other change re-introduced it and the regression was not caught.

Something to fix for next time, I suppose. :-)

# Björn on Thursday, October 05, 2006 4:56 PM:

(Hijacking an sort of unrelated entry)

While reading this entry the particles of inspiration hit me: why not try to "fix" the keyboard mapping of my notebook to a) get rid of the caps lock key a b) get an easier to reach "Context menu" key (the original one is located atop of the F9 key), just to find out that neither seems possible.

So, these questions arose:

1) Is it possible to deactivate the caps lock key through MSKLC or if not, is there another (easy) way to get rid of it?

2) Can one utilize non standard keys (my laptop [like many other] has an extra Fn key) in MSKLC? Or do I need to hack a custom keyboard driver to get Fn+Left Alt send the WM_CONTEXTMENU message?

# Björn on Thursday, October 05, 2006 5:00 PM:

I should have read [1] before posting the above comment. It pretty much looks like I need to do my own keyboard thingy :)

[1] http://blogs.msdn.com/michkap/archive/2005/08/05/448225.aspx

# Dean Harding on Thursday, October 05, 2006 8:42 PM:

Björn: I'm not a fan of caps lock either. I never use it, and I always seem to inadvertently hit it...

# Björn on Friday, October 06, 2006 9:57 AM:

Dean, yeah, that is the reason why I want to get rid of it - and I am soooo happy that my MS keyboards software on the desktop allows me to disable it :)

# ReallyEvilCanine on Friday, October 06, 2006 2:25 PM:

[Edited to turn the evil dog's HTML (which is not supported by commenters as the page mentioned!) into actual HTML -- next time I'll probably just assume it is spam (it was detected as such) and delete, and make him repost. Nothing personal! :-) -- michkap]

How to disable capslock

The short version:

1) Go to HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layout
2) Create a REG_BINARY entry called Scancode Map
3) Give the value data: 00000000 00000000 0200000000 2A003A00 00000000
4) Reboot (ARGH!!!!!)

Me, I just rip the damned thing off every keyboard I own. It's only a problem when playing GTA but you can remap the keys in that. Horn goes on the left shift where it used to be in GTA3 and GTA:VC.

# Michael S. Kaplan on Friday, October 06, 2006 3:25 PM:

Hopefully people will understand why MSKLC (a tool developed by folks on a Windows International team) would not specifially target this scenario.


# ReallyEvilCanine on Friday, October 06, 2006 5:12 PM:

Thanks for fixing the comment. There's no preview and I can't see the results immediately so I didn't know. Is there some guideline to the allowed code for posting?

Also, I really DON'T know why you don't just kludge in an option to kill or reassign the craplock key. Yes, at the hardware level it's hadled by the keyboard but since the KLC works at the scan code level, why isn't NULL-assigning that hellish key a possibility?

The last time I used the key for anything other than an office weapon whenever getting a replacement keyboard (about once every three months) was in 1998 as I did some COBOL Y2K work.

# Michael S. Kaplan on Friday, October 06, 2006 5:20 PM:

If you read the text right above the comment line in  browser, it lays out what works and what does not.

Of course no one ever reads it before they leave a comment. :-)

As for the CAPS LOCK key, asked and answered. But if you want more:

Not everyone hates and some keyboard use SGCAPS and need it. It is not an internationalization issue and so it is not a part of MSKLC's mandate to do something with.

# ReallyEvilCanine on Friday, October 06, 2006 5:36 PM:

You're not /. -- I actually do try to read everything. Didn't notice any HTML guide.

Not to belabour the point but there is some I18N aspect to the craplock key: in some locales it's a toggle whereas in others one must hit the left shift to shut it off in keeping with the typewriter convention on which it's based.

# Michael S. Kaplan on Friday, October 06, 2006 5:41 PM:

Have you run MSKLC before? :-)

Those aspects of CAPSLOCK are related to language support and are specifically configurable. One can design a layout that causes the CAPSLOCK to have no effect.

But MSKLC is for per layout changes, and not for a "destroy the key on all layouts" functionality. Even if there were a language argument for it -- which there is not.

More to belabor? Or can we get back to the actual topic? :-)

# Random note in passing on Friday, October 06, 2006 8:49 PM:

Same solution as the Apple II reset key: Pry it off with a screwdriver. And thinking of those bad old days ... wasn't it shortly thereafter when a universal fog of amnesia caused everybody to forget to escape delimiters? Practically every application I use these days that claims to export and import data as text fails to even round-trip its own files correctly.

# Michael S. Kaplan on Friday, October 06, 2006 9:03 PM:

Amazing how many people need to keep this offtopic thread going.

People, move it over to the other post, or I start deleting. LAST WARNING!!! :-)

# Daan Nusman on Sunday, November 12, 2006 7:18 AM:

Thanks for the tip! That indeed fixed the error message I got  :)

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

2006/10/06 If you hate the CAPS LOCK key, please read this!

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