windows 如何制作自定义键盘布局?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/826986/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 12:24:32  来源:igfitidea点击:

How to make a Custom Keyboard layout?

windowskeyboardkeyboard-shortcuts

提问by AnnanFay

What's the best way to make a keyboard layout for Windows?

为 Windows 制作键盘布局的最佳方法是什么?

Specifically a layout that will appear in the 'Text Services and Input Languages' list and without buying expensive software.

特别是将出现在“文本服务和输入语言”列表中且无需购买昂贵软件的布局。

I know about the Microsoft Keyboard Layout Creator but find it completely limited as you can't do simple things like remap the CapsLock key or the number keys.

我知道 Microsoft 键盘布局创建器,但发现它完全受限,因为您无法执行诸如重新映射 CapsLock 键或数字键之类的简单操作。

回答by andrewdotn

For remapping CapsLock or the number keys, use remapkey.exefound in the Windows 2003 Resource Kit Tools.

对于重映射CapsLock键或数字键,使用remapkey.exe中发现的Windows 2003 Resource Kit工具

enter image description here

在此处输入图片说明

Keyboard layouts that show up in “Text Services and Input Languages” can't remap CapsLock or do anything not supported by Microsoft Keyboard Layout Creator; the operating system just doesn't support it. Anything that Microsoft can do with a keyboard layout, you can do with Microsoft Keyboard Layout Creator.

显示在“文本服务和输入语言”中的键盘布局无法重新映射 CapsLock 或执行 Microsoft Keyboard Layout Creator 不支持的任何操作;操作系统只是不支持它。Microsoft 可以使用键盘布局执行的任何操作,您都可以使用 Microsoft Keyboard Layout Creator 执行。

回答by RolKau

You can build one yourself! A keyboard layout is basically a .DLL with a function that returns a table of assignments. The driver kitcontains examples, and my Programmer Dvorakcomes with source too (which is not derived from the DDK).

你可以自己建一个!键盘布局基本上是一个带有返回赋值表的函数的 .DLL。该驱动程序工具包中包含的例子,我的程序员德沃夏克带有源太(这是不是从DDK得出)。

回答by AuralArch

I realize that this thread is quite old and dead, but the answer provided is inaccurate.

我意识到这个线程已经很老了,但提供的答案不准确。

You can do exactly what you want to do with KbdEdit. It is not free, but it is not expensive by any means, and there are several versions with varying features.

你可以用KbdEdit做你想做的事。它不是免费的,但无论如何也不贵,并且有几个具有不同功能的版本。

I would also like to point out that despite the claims of the highest rated answer, the operating system, in fact, most certainly DOES support a multitude of complexities and customizations which MSKLC can not understand, process or support. There are—and always have been—MANY features and behaviors of keyboards which are possible in Windows but which are impossible with MSKLC.

我还想指出,尽管声称评分最高的答案是操作系统,但事实上,它肯定支持 MSKLC 无法理解、处理或支持的多种复杂性和自定义。有——而且一直以来——许多键盘的特性和行为在 Windows 中是可能的,但在 MSKLC 中是不可能的。

In a number of cases it is possible to create as much as possible with MSKLC and then modify the source file in a text editor and then to build the DLL using the command line tools supplied with MSKLC. But it is my understanding that at a certain point—with certain features—those tools can not even be used to generate working keyboards. At this point you could turn to the driver development kit, but that is beyond my scope.

在许多情况下,可以使用 MSKLC 创建尽可能多的文件,然后在文本编辑器中修改源文件,然后使用 MSKLC 提供的命令行工具构建 DLL。但我的理解是,在某些时候(具有某些功能),这些工具甚至无法用于生成工作键盘。此时您可以转向驱动程序开发工具包,但这超出了我的范围。

Fortunately, there's KbdEdit! It is extremely powerful, easy to use and it can change any key on most any keyboard to any other key—except for the "Pause" key, which is a Microsoft imposed restriction, but even that can be circumvented with AutoHotKey.

幸运的是,有 KbdEdit!它非常强大,易于使用,并且可以将几乎任何键盘上的任何键更改为任何其他键——除了“暂停”键,这是微软强加的限制,但即使是这样也可以通过 AutoHotKey 规避。

Cheers!

干杯!

回答by numediaweb

did you check the new version of Microsoft Keyboard Layout Creator, I think you can do many things with this new version like remapping keys.

您是否检查过新版本的 Microsoft 键盘布局创建器,我认为您可以使用这个新版本做很多事情,例如重新映射键。

回答by Frank Nocke

I am a fan of Auto Hotkey, a free, small, non-fuzzy windows tool to assign macros to keys. If all you want is a few special characters like proper “Quotation Marks” —or em-dashes— this is great:

我是Auto Hotkey的粉丝,这是一个免费的、小型的、非模糊的 Windows 工具,用于将宏分配给键。如果你想要的只是一些特殊字符,比如适当的“引号”——或破折号——这很好:

#NoEnv;
SendMode Input;

!1::
    {
        Send ?
    }
return

!2::
    {
        Send “
    }
return