Change input locale (keyboard -- left shift+ alt + 1) key sequence PROGRAMMATICALLY

On XP, if you go to

control panel -> regional and language Options -> Languages Tab -> Details -> 

If you have more than one keyboard in use, then, click Key Settings. Those are the settings I would like to change. I would like to set it up so that the DVORAK keyboard is Left Alt + Shift + 1. I can use C++, C# or whatever. I already know how to load a keyboard:

HKL dvorakhkl = LoadKeyboardLayout(TEXT("00010409"), 0);

That loads the dvorak keyboard. This sets it to default:

SystemParametersInfo(SPI_SETDEFAULTINPUTLANG, 0, (PVOID)&dvorakhkl, 0);

Also, I can change the top part of said dialog box

"Switch between Input Languages"

UINT val = 1;//"1" = ALT+SHIFT, "2" = CTRL+SHIFT, and "3" = none.
System.ParametersInfo(SPI_SETLANGTOGGLE, 0, 0, val);

Let me know if you can help. Thanks!

Aaron

Answers


By default all programs use the C local (Because we all program in C dialects I suppose)

You can imbue streams with an appropriate local. Just remember that you must imbue the stream before opening/using it. An attempt to imbue a stream after it has been opened/used will be silently ignored.

This means that for std::cin and std::cout you should probably do it immediately on startup in main() to avoid the potential of them being used.

When creating a locale object if you specify the empty striung it will pick up the name of the local from the environment (ie one of the environment variables).

See: http://www.cplusplus.com/reference/iostream/ios_base/imbue/


Need Your Help

J function is not working

math j

I am a complete beginner to J. My first attempt at writing a function is something like the totient function. It takes an array, assumed to be i.num for some number, num. And then computes the numb...

Screenscraping a Datepicker with Scrapy + Selenium

selenium selenium-webdriver datepicker scrapy screen-scraping

So i need to scrap a page like this for example or this and i am using Scrapy + Seleninum to interact with a datepicker calendar.