Not quite so portable as that...

by Michael S. Kaplan, published on 2010/01/31 07:01 -05:00, original URI: http://blogs.msdn.com/b/michkap/archive/2010/01/31/9955888.aspx


Over in the Suggestion Box, DreymaR asked:

Hello Michael, and thanks ever so much for sharing insights about the workings of the Windows layout routines!

I hope you're the person to ask about this, or if you aren't, that you could tell me who might be?

In these days I'm very portable, and happily so. I 'take my digital life with me' by USB flash drive, and this allows me to work comfortably on computers where I have no installation rights. That's nice!

When it comes to the keyboard layout however, I'm not yet fully satisfied. I've used MSKLC to make an enhanced layout (Unicode, some keys moved around etc) that I'm very fond of. I can use the freeware script PortableKeyboardLayout to take that with me, but this solution is imperfect because it's too slow at times (it's written in a scripting language) and doesn't always play 100% nice with the input stream. (It has other virtues, but that's another matter.)

So what I'd really like would be to be able to code or script an analogue to the LoadKeyboardLayout API, that instead of looking in the registry and system folders could take its values from a specified file and an MSKLC-made install! (I hope I'm right in thinking that what the MSKLC installer does is detect the architecture and then simply copy the right .dll and some registry values to where the system expects them to be?)

That way, I could run a script or program that loaded and activated a layout from my USB drive, without installing anything to the local hard drive! Any tips/ideas whether this is doable and if so, how?

Now Bob knows I hate to be the bearer of bad news....

But this is a capability that MSKLC does not provide, and there is no back door into the sanctioned input stream in Windows to support what is being requested here.

Now obviously Text Service Framework (TSF) Text Input Profiles (TIPs) can accomplish this, but they are complex DLLs that also require administrative permissions to write to the registry and let the system know where they are. There is no mechanism for inserting an input method without that level of access/authority on the machine....

Sorry about that!


Mihai on 1 Feb 2010 10:03 AM:

"without that level of access/authority"

Depending on the type of customizations required, a lot of stuff can be done with keyboard hooks.

Not very elegant, nice, and clean to use "for real"

But if the request is for something that you run on a random system without being admin, then it's gone like it was never there, hooks are probably the only way.


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