以编程方式更改输入区域设置(键盘 -- left shift+ alt + 1)键序列
在 XP 上,如果您转到“
control panel -> regional and language Options -> Languages Tab -> Details ->
如果您有多个键盘正在使用”,则单击按键设置
。这些是我想更改的设置。我想将其设置为 DVORAK 键盘为 Left Alt + Shift + 1
。我可以使用 C++、C# 或其他语言。我已经知道如何加载键盘:
HKL dvorakhkl = LoadKeyboardLayout(TEXT("00010409"), 0);
加载德沃夏克键盘。这将其设置为默认值:
SystemParametersInfo(SPI_SETDEFAULTINPUTLANG, 0, (PVOID)&dvorakhkl, 0);
另外,我可以更改所述对话框的顶部
“输入语言之间切换”
UINT val = 1;//"1" = ALT+SHIFT, "2" = CTRL+SHIFT, and "3" = none.
System.ParametersInfo(SPI_SETLANGTOGGLE, 0, 0, val);
如果您能提供帮助,请告诉我。谢谢!
亚伦
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
默认情况下,所有程序都使用 C 本地语言(因为我想我们都用 C 方言编程)
您可以使用适当的本地语言来填充流。
请记住,在打开/使用流之前必须先注入流。在打开/使用流后尝试注入流将被默默地忽略。
这意味着对于 std::cin 和 std::cout 您应该在 main() 启动时立即执行此操作,以避免它们被使用的可能性。
创建语言环境对象时,如果指定空字符串,它将从环境中获取本地名称(即环境变量之一)。
请参阅:
http://www.cplusplus.com/reference/iostream/ios_base/imbue/< /a>
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/